[thelist] CSS -- two divs inside a horizontally centered div of fluid width

Lonnie Kraemer lwkraemer at earthlink.net
Fri Feb 7 16:35:54 CST 2003


> I'm banging my head over this one -- there has to be a simple way of
> getting this to do what I'm after :)
>
> Hopefully this explains what I'm wanting:
>
> <div id="main">      # width 80%, centered on page
>
> <div id="sidemenu">  # 120px wide, on the left
> ...
> </div>
>
> <div id="content">   # fills up the rest of the 80%, on the right
> ...
> </div>
>
> </div>

Have you tried:

#main {width:80%;margin:0 auto;}
#sidemenu {width:120px;float:left;}
#content {margin-left:120px;}

<div id="main">
<div id="sidemenu"></div>
<div id="content"></div>
</div>



More information about the thelist mailing list