Previous Message
Next Message

Re: [css-d] simple(?) css layout

Sent by noah on 29 January 2002 16:04


Thanks to everyone who responded on this. I learned a lot about how float 
works.

If it's in Eric's book, then I will happily revise my opinion that using a 
big margin to push the content div beyond the menu div (rather than 
floating it) is cheesy.

The suggestion to position the menu div absolutely in order to prevent NN4 
from applying the margin starting at the right side of the menu div is a 
good one, but I was trying to avoid this so that the title div (which comes 
above both the menu and the content) can be of variable height. I'd like 
the menu to be 20px below the title, regardless of how high the title is 
(it's text, so it might wrap at small screen size), which is obviously not 
possible if the menu is absolutely positioned..

At 12:14 PM 29/01/2002, Mark Newhouse wrote:
>I've found that if you give the floated DIV (in your case #menu) a small
>negative left margin (e.g. -1px), NN4 browsers will render the content DIV
>basically where you want it. I guess the negative margin makes Netscape
>ignore the width of the floated DIV when calculating the margin for the
>content DIV.

Thanks very much - that worked perfectly. Now I can leave the menu 
relatively positioned, and the content div appears in roughly the right 
place in NN4. It seems like a bit of a hack, but I'm beyond the point of 
worrying about that.

Thanks again,
Noah
Previous Message
Next Message

Message thread: