Re: breaking overflow

James Hopkins wrote:

(snip)
>> I don't think it is any worse that relying on a side effect of 
>> overflow settings. In fact, I think that creating a presentaional 
>> effect of a separate markup element without having the actual element 
>> present in the markup is a perfectly valid and important use case for 
>> ':after' (or with the ':before' example I posted earlier).
> 
> I'm not arguing that the generated content method is inferior; the 
> 'overflow' method is just as much of a hack.

Why is it a hack? As Brad has said somewhat, the margin box of floats 
can not cross the content box of a BFC. Certain CSS properties were 
designed for certain reasons but the true scope or behaviors of these 
properties have only being realized recently.


> Throughout the years, authors have adopted several unofficial techniques 
> to clear floats.
(snip)


One way I clear floats is by floating the container of these floats. I 
can do this right up the HTML hierarchy until I reach the body. The body 
element itself behaves as auto clearing overflow box.

Another use of overflow:hidden is to trim the margin-box of a block 
level element in normal flow to the margin-edge of a sibling float. The 
purpose of this is to allow a border of this element to stop at the same 
place as other siblings with inline content or line boxes.


<div>
   <img style="float: right; margin-left: 40px;"></img>

   <h2 style="border-bottom: 2px solid black; overflow: 
hidden;">Heading</h2>

   <p>Text Text Text Text Text Text Text Text</p>
</div>


-- 
Alan http://css-class.com/

Received on Friday, 1 January 2010 12:03:39 UTC