[thelist] i don't like css (because i can't do it right?)

Chris Marsh chris at webbtech.co.uk
Thu Dec 12 12:07:01 CST 2002


> ok. this is really getting to me. i have a page that is
> xhtml/css transitional. i have a header, a left nav, and a
> content. these all container divs. if i float two divs within
> the content div (one div contains some regular markup, the
> other contains an iframe), one of the divs (the one with the
> regular content) extends below the content container div. why
> does it do that? i even added a <div class="spacer"></div> at
> the bottom of the container div thinking it would force the
> container div to be as tall as the content. alas, it does not
> work this way.
>
> i am really not liking css since it seems to be such a pain.
> but then again that's probably just because i don't know what
> i'm doing yet. and yes, at the time of this writing the page
> was valid.

Try putting <div style='clear: both'>&nbsp;</div> before the first
floated DIV and after the last floated DIV. This should force the
container DIV to recognise the fact that it has content without messing
up your formatting too much. This *will* however give you "padding" at
the top and bottom of the container, so you might want to substitute a
1px spacer gif for the &nbsp;.

Regards

Chris Marsh





More information about the thelist mailing list