Re: Trying to understand overflow:hidden
- From: Joshua Cranmer <Pidgeot18@xxxxxxxxxxx>
- Date: Tue, 28 Aug 2007 14:40:33 GMT
lyallex wrote:
If I simply add overflow:hidden to outer and reload the page
the border for outer extends below the two floating divs, Previously, outer had no content, now apparently it does. I'm confused. I think it might have something to do with the clip attribute but this behavoiur doesn't seem to follow [my understanding of] the spec at all.
For future reference, the most confusing and important part of the spec is probably §10 Visual formatting model details. That is the part that actually tells you how to compute values.
By default, the overflow property is 'visible'. Relevant section: §10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' (helpful title!)
[ ... ]
Only children in the normal flow are taken into account (i.e., floating boxes and absolutely positioned boxes are ignored, and relatively positioned boxes are considered without their offset).
When overflow is set to hidden, the height computation changes to §10.6.7 'Auto' heights for block formatting context roots
[ ... ]
In addition, if the element has any floating descendants whose bottom margin edge is below the bottom, then the height is increased to include those edges.
I won't deny I'm struggling to understand the spec.
The hardest parts of the spec are trying to figure out which section to look at (sections §8-§11 all deal with the formatting model but §10 is probably the most relevant for problems, as it is the most confusing).
I would also say that the CSS spec is the most difficult-to-understand spec I've ever read.
--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
.
- Follow-Ups:
- Re: Trying to understand overflow:hidden
- From: lyallex
- Re: Trying to understand overflow:hidden
- References:
- Trying to understand overflow:hidden
- From: lyallex
- Trying to understand overflow:hidden
- Prev by Date: Trying to understand overflow:hidden
- Next by Date: little issue with positioning
- Previous by thread: Trying to understand overflow:hidden
- Next by thread: Re: Trying to understand overflow:hidden
- Index(es):
Relevant Pages
|