Reputation: 7956
I need left div as menu and right as content.
I'm trying to adopt the accepted answer from this post:
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>
Upvotes: 1
Views: 1022
Reputation: 8012
Try this one
#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>
Upvotes: 1
Reputation: 381
Have you tried giving the right div a float too?
#right {
width: 500px;
margin-left: 170px;
float: left;
}
a jsfiddle to show you it works :)
Upvotes: 2