Forum Moderators: not2easy

Message Too Old, No Replies

Changing div order

         

marv

12:10 pm on Apr 8, 2004 (gmt 0)



For some time now I've been trying to change the order in which 2 divs appear. Here is an example to understand what I'm trying to do.

<div id="header">
...
</div>

<div id="menu">
...
</div>

<div id="content">
...
</div>


What I wanted to do with CSS, is make the menu div, show on top of the header div. It's pretty easy to do if I changed their order in the HTML. Another thing I thought about, was to set the menu to position: absolute and apply a margin-top to the header and be done, but when the font gets resized, the menu will go over the header. Does anyone have an idea how this can be accomplished without touching the HTML, and also make the menu stay in the normal flow so that when the text gets resized, it doens't overlap the header?

Rambo Tribble

12:53 pm on Apr 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can size your divs in ems and position them with ems as well. Use position:relative with a negative top or top margin value on the second div and a positive value on the first. Then everything should scale.