5 ms·
I don't understand why people keep trumpeting this like it's a big revelation. Because the dependency on entry order makes the div's class semantically meaning
by gcv 18y ago
I don't understand why people keep trumpeting this like it's a big revelation.
Because the dependency on entry order makes the div's class semantically meaningless. Yes, the order in tables makes a difference, but in a table, that makes sense. With CSS, however, if I add a div with a class name like "center_column", then I expect to be able to put it anywhere in its enclosing context, and it should render in the center of that context.
CSS as an abstraction leaks, and it leaks blood. It seems that CSS-supporting designers (on this thread and elsewhere) accept this far more readily than hackers. A table is a table is a table: you expect its order to matter, so no one blinks when this turns out to be the case. CSS looks superficially like it provides a higher level of abstraction, but it (1) does not, and (2) requires considerably more effort to get right.
- olavk 18y agoBy putting presentational info into a class name, you break the abstraction.
- GHFigs 18y agoYou don't know what you're talking about. "center_column" illustrates that. You're still pretending that floats are tables, which they are not and never were intended to be. That's my point, and it went way over your head.
- gcv 18y agoLet me try a different class name and a more thorough example. <div class="article"> <div class="author"> John Q. Public </div> <div class="text"> Some text goes here. </div> <div class="date"> February 3rd, 2009 </div> </div> To me, this looks like an abstract thing. It says that an article consists of an author, text, and a date. The stylesheet should take care of rendering these elements in any layout the designer implemented inside that sheet. If the rendering breaks just because author goes to the end of the list, the abstraction leaks. It means that (author, text, date) is an article, but (text, date, author) is not.
- olavk 18y agoYou can override the ordering by using absolute positioning. It has some drawbacks though, for example you have to define sizes explicitly. But I dont really see your point in favor of tables, since CSS is strictly more powerful in this case.
- GHFigs 18y agoIt isn't an abstract thing, it's HTML, and it behaves like HTML. That CSS styles HTML is not an implementation detail -- it is dependent on the underlying document tree, not an abstraction of it. As I said before, floats do not change that (from the CSS2 spec): In the float model, a box is first laid out according to the normal flow, then taken out of the flow and shifted to the left or right as far as possible. Content may flow along the side of a float. What you're asking is to be able to modify the document tree, which modifies the normal flow, and then have something which explicitly depends on the rendering of the normal flow to not change.
- joe_the_user 18y agoMod up parent This gives the best critique of divs I've read. And till this morning, I favored divs as an approach