Previous Message
Next Message

clearing a float without clearing another float

Sent by Zoe M. Gillenwater on 20 December 2005 15:03


CJ Larson wrote:

>In the first url, http://offlead.com/stuff/floattest/index.html,
>the H3 element and everything below it is supposed to be below the
>floated thumbnails and the first paragraph of text. Sometimes there is
>one thumb, sometimes two. Sometimes a short intro paragraph, sometimes a
>long one.
>Regardless of whether the intro is longer than the thumbs or vice versa
>(which is more usual), the H3 should be on a clean line, not wrapped up
>next to the thumbs. The index2.html page has it below it, but of course
>the clearing div also clears the floated left column, dropping the h3
>and content below it all the way down the page. I need it just right
>under the thumbs.
>  
>

This happens because your content column is in the same "block 
formatting context" as the left floated sidebar.  Thus, clears within 
the content column will also clear the left float.  To stop this, you 
need to establish a new block formatting context for the content 
column.  This will make clears within it ignore stuff outside of it, 
which is exactly what you want.  To establish this new context, you can 
float the content column as well.

Zoe

-- 
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: