5 ms·
It's a lovely story, but it isn't true. Designers have been trying to create grid-based layouts since the beginning of the graphical web. CSS was created after
by aboodman 17y ago
It's a lovely story, but it isn't true.
Designers have been trying to create grid-based layouts since the beginning of the graphical web. CSS was created after that, and its creators did not see fit to bestow on us the basic tools (flexible boxes) that could be used to create these layouts elegantly.
As a result HTML and CSS have always been coupled. Only by using both together, can engineers create the layouts designers want.
This most certainly is a failing of CSS. Sadly, it is also a failing of the web development community, who looked for progress from the one group of people who were completely incapable of delivering it.
- olavk 17y agoCSS does support flexible grids (with power equivalent to HTML tables), it is just that IE has not supported it until IE8, which means it hasn't been used widely. I fint it strange that people keep blaming the shortcomings of IE6+7 on the CSS standard.
- aboodman 17y agoReference? Are you referring to http://www.w3.org/TR/css3-grid/ http://www.w3.org/TR/css3-grid/? Which is at the working draft status?
- olavk 17y agoCSS2 (which has been a recommendation for a decade) supports display:table, which is equivalent to the layout model of HTML-tables: http://www.w3.org/TR/CSS21/tables.html#value-def-table http://www.w3.org/TR/CSS21/tables.html#value-def-table The working draft you refer to is a new model which is more powerful than either HTML tables or CSS2.
- wvenable 17y ago...which will be great in 2015 when enough browsers implement it to be useful. :)
- aboodman 17y agoCSS emulation of tables doesn't meet the requirement though. The question was whether CSS supports the primitives required to do grid layouts without coupling the CSS to HTML, effectively requiring the two of them to be treated as object code. If you're going to require that the markup contain divs that are ordered and nested just so, so that they can be styled to layout like a table, then you might as well just use a table. Either way you are coupling presentation to semantics.
- olavk 17y agoCSS is obviously always coupled to HTML in the sense that CSS applies styling and layout to elements in HTML. If you don't have an element to delimit the chunk of content you want to style, you cant do it with CSS. The point is just that the markup HTML should be independent of any particular presentation. You don't have to use divs, you can use semantic elements (P, whatever) if that is appropriate for the content. You definitely might not just as well use a table. The trouble with tables for layout is that they have the wrong semantics, which means they makes the page less accessible.