Thursday, September 11, 2008

CSS is making sense... ?

While reading the 'Elaborate Description of Stacking Contexts' section of the CSS2.1 spec, I had an inkling of understanding of why blocks, floats, and inlines were grouped on separate z-layers. Clearly, I was doing something wrong.

Floats are positioned to touch other floats, or the containing block, so putting them together sort of makes sense in terms of implementation-driven semantics. However, they can't go 'higher' than preceding elements, and cleared elements will further break them up. I'd expect some sort of lock-step algorithm from top-to-bottom picking out a float and then filling text until the next float -- stacking based on this would make more sense, visually and wrt implementation. Worse, normalization (inserting pseudo-elements until all children are either block or inline..) probably further breaks up relationships between floats. Why isn't it simply the relationship implicit from document structure + explicit z-indexing??

I don't know whether to criticize such a spec or donate money to people who understand why it should be so and then actually go and implement it. And I thought continuations were loopy..

No comments: