Previous Message
Next Message

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

Sent by Eric A. Meyer on 29 January 2002 11:11

At 1:14 -0500 1/29/02, noah wrote:

>I've managed to accomplish this (at least in IE 5.5 and Moz 0.9.6 / 
>pc) by giving the content div a left margin that pushes it beyond 
>the menu, and not giving it a float (see 
>This seems a little cheesy to me (though I'm not sure why), and it 
>doesn't come off very well in NS 4.7.

    Cheesy or not, it's the precise design approach now being used for 
the css-discuss pages (see link in footer) and on the recently 
redesigned  I feel strongly that if you have two 
side-by-side elements and you're pretty sure one of them is going to 
be longer than the other, then either float or position the shorter 
one and give the longer one a margin big enough for the 
floated/positioned element to sit in.  It's simple, straightforward, 
and leaves most of your document in the normal flow.
    I advocate this approach by example in chapter contributed to an 
upcoming DHTML book, and in my next CSS book as well.  There are time 
when you want to position everything, but they're actually more rare 
than we might think.
    It's true this won't work well in NN4.x when floating, but on 
meyerweb and the css-d pages I avoided this by hiding the float 
styles from NN4.x.

>What I'd really like to do is float the content div and just have it 
>fill up the available space to the right of the menu.

    As Andrew pointed out, this is harder to do in CSS.  My question, 
though, is why?  I don't see what it would gain you to do this that 
you don't already have in your test design.

Eric A. Meyer (, List Chaperone
"CSS is much too interesting and elegant to be not taken seriously."
   -- Martina Kosloff
Previous Message
Next Message

Message thread: