gpt4 book ai didi

css - 使右 div 位于顶部而不是底部

转载 作者:太空宇宙 更新时间:2023-11-03 22:07:16 26 4
gpt4 key购买 nike

如何使正确的 div 位于顶部而不是底部?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body
{
padding: 0;
margin: 0;
}
#all
{
width: 955px;
margin: 0 auto;
background: #F4FEC0;
}
#dleft
{
margin-right: 200px;
}
#dright
{
float: right;
width: 200px;
margin-left: 755px;
}
</style>
</head>

<body>

<div id="all">
<div id="dleft">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et odio elit. Praesent ut sem nibh, non ultricies purus. Integer viverra dapibus nulla. Nulla quis quam mauris, et faucibus arcu. Integer quis est a libero lacinia tincidunt. Duis dignissim dui nec quam vehicula nec eleifend dolor scelerisque. Cras vehicula, mauris quis pretium gravida, justo tellus tincidunt nunc, faucibus euismod enim sapien at neque. Fusce quis elit ut elit commodo pulvinar id sit amet urna. Mauris sapien lacus, auctor eu posuere at, mattis in elit. Sed congue ultricies diam, sit amet placerat quam rutrum ac. Vivamus pellentesque tristique nisi, a consectetur sem dignissim in. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc rhoncus dolor nibh. In ornare mattis lectus, id mattis felis iaculis vel. Maecenas quis tellus eu est luctus mattis eu id urna. Vestibulum eu elit eget magna malesuada adipiscing. Vestibulum sem neque, condimentum eget luctus vel, rhoncus vel tellus. Donec egestas quam id erat dignissim tempus. Cras volutpat erat ac enim fermentum eu convallis quam porttitor. Quisque ac tellus sit amet libero interdum sodales.
</div>
<div id="dright">
menu<br />
menu<br />
menu<br />
menu<br />
</div>
</div>

</body>
</html>

最佳答案

#dleft
{
float:left;
width:755px;
}
#dright
{
float: left;
width: 200px;

}

关于css - 使右 div 位于顶部而不是底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4890639/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com