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

Rachel Cunliffe r.cunliffe at auckland.ac.nz
Fri Feb 7 16:11:01 CST 2003


Hello..

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>

My problem is in getting the content div to lie just to the right of the
sidemenu.  Position relative seems to always put it underneath the
sidemenu, position absolute is tricky because I don't know the left
position (as the main div is centered on the page).

I can get it to work (almost) by floating the menu left, and floating
the content right, but if the content is not very wide, it *looks* like
the text is right aligned (even though it is left aligned by style).

Any help greatly appreciated!

- R




More information about the thelist mailing list