我需要将div作为菜单,将内容作为内容
我试图采纳这篇文章中接受的答案:
CSS: how to get two floating divs inside another div
#container {width:900px;}
#left {
width: 150px;
float: left;
}
#right {
width: 500px;
margin-left: 170px;
}
.clearBoth{clear:both;}
HTML
<div id="container">
<div id="left">leftMenu</div>
<div id="right">rightContent</div>
<div class="clearBoth"></div>
</div>
答案 0 :(得分:2)
你是否尝试过给予正确的div一个浮动?
#right {
width: 500px;
margin-left: 170px;
float: left;
}
向你展示它的作用:)
答案 1 :(得分:1)
试试这个
#container {width:900px;}
#left {
width: 500px;
float: left;
}
#right {
width: 500px;
float: left;
}
.clearBoth{clear:both;}
<div id="container">
<div id="left">leftMenu</div>
<div class="clearBoth"></div>
<div id="right">rightContent</div>
</div>