3 ms·
Let me try a different class name and a more thorough example. <div class="article"> <div class="author"> John Q. Public </div> <div class=
by gcv 18y ago
Let 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.