Re: [CSS21] 9.5.2 Effect of adjacent top margin of first in-flow child on clearance

Bruno Fassino wrote:
> On Sun, Jan 24, 2010 at 5:37 PM, Anton Prowse <prowse@moonhenge.net> wrote:
> 
>> the "easyclearing" technique whereby
>> div:after {
>>    content: "";
>>    display: block;
>>    clear: both;
>> }
>> causes the div to expand to enclose its floated children, even though
>> the generated content is empty)
> 
> 
> There are other cases when an
> 'empty' clear is not sufficient to make its parent to enclose floats
> (because no clearance is necessary), for example:
> 
> <div style="background:lime">
>  <div style="float:left; width:100px; height: 100px; background:blue"></div>
>  <div style="height: 50px; margin-bottom: 50px"></div>
>  <div style="clear: left"></div>
> </div>
> 
> (online here http://www.brunildo.org/test/margin-collapse-clear-7.html)
> 
> So I think easyclearing is always better applied with non empty
> generated content and then height:0, visibility:hidden

Agreed, I hadn't thought about that sort of situation.  Your point is 
very relevant to the easyclearing debate (as well as to the current 
discussion).

[Strictly, in order to avoid this kind of situation, the generated 
content in the easyclearing technique needs to be more that just 
non-empty: it cannot consist merely of whitespace which collapses to 
nothing.]

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Monday, 25 January 2010 17:07:52 UTC