Flamin’ CSS
Dave Winer, in a follow up to his recent CSS problems:
I used to work reasonably well with designers until CSS came along. Now my writing is supposed to be a soldier in the fight for Web “standards.” Help. My work has to look great in MSIE, and I can’t wait for the other browsers to fix their bugs. So I’m going to use paragraphs and breaks and old unbuggy stuff like that where I need to.
Mark Pilgrim responds:
I used to work reasonably well with Dave Winer until the RSS validator came along. Now my feed is supposed to be a soldier in the fight for “validation” and “standards”. Help. My syndicated feed has to look great in NetNewsWire (according to my site statistics, it has more than 4 times the market share of Radio), and I can’t wait for the other newsreaders to fix their bugs. So I’m going to skip required elements and use invalid XML whenever it suits me, and to hell with the validator, and to hell with these newfangled “standards”.
Jeffrey Zeldman offers some solid arguments against tag soup:
Over the past two years, Mr Winer has repeatedly complained about CSS and structural, semantic markup, and has even asked what is wrong with tag soup. As one who sees the web as a vehicle for writing, Mr Winer should know instinctively what is wrong with tag soup. Tag soup bloats web pages, slowing their delivery for all users and especially penalizing dialup users. Tag soup corrupts data by yoking it to nonstandard formatting instructions. These formatting instructions work in some environments but fail in others. For instance, they get in the way when trying to deliver content to text-oriented devices with small view ports, such as Palm Pilots and web-enabled cell phones. Why should the users of these devices be forced to download 40K of HTML formatting instructions that will not work for them? And then have to download 40K more when they link to a new page? And 40 more on the next?
Those are the key posts. The resulting flame war can mostly be found here (along with trackbacks to pretty much every other bit of blog coverage).
Meanwhile, Sterling Hughes poses a valid point in favour of presentational markup in response to Sam Ruby:
Your site [code] still is signifigantly harder to read, at least for me. I’m constantly cross referencing—HTML to CSS, HTML to CSS, HTML to CSS, HTML to ... When you dissassociate style information, I contend that its really not about the humans editing the file anymore. Its about robots understanding the file. This point is made even clearer by XHTML 2.0, where they remove the style attribute.
This is certainly a problem with CSS layouts—their maintainability can suffer due to the separation of the presentation from the layout (itself the greatest advantage that CSS provides). Tools such as the ViewStyles, ancestors and ShowDivs bookmarklets certainly make this easier but to my knowledge no one has written a bookmarklet that shows the inherited styles for the currently selected element—at least not yet. Pixy’s List Computed Styles comes close, but shows styles for every element in the document all in one big window.
So Dave dislikes CSS because support is buggy, while Sterling sees it as adding extra complexity. Buggy suport is pretty much a solved problem now, at least for most simple layouts—the CSS-Discuss Wiki is accumulating information on how to defeat bugs at a very decent rate and any problems not solved on there are certain to be understood by the friendly inhabitants of the CSS-Discuss mailing list. As for the extra complexity argument, laying out web sites with HTML has always been complicated—take a look at any site that uses nested tables to see what I mean.
In my experience, resistance to CSS seems to come mostly from people who have been creating table based layouts for years. This is unsurprsing—they are being told to throw out everything they have learnt and start with a completely clean slate. I think the real evidence that CSS is a less complex way of laying out pages comes from new developers; I recently taught my girlfriend to design pages (starting from no previous experience) and she took to CSS like a duck to water.
Dave Winer - 20th April 2003 18:35 - #
Stuart Langridge - 20th April 2003 21:28 - #
Thijs van der Vossen - 20th April 2003 21:59 - #
Similarly, I entered the web design scene at a point in time where I jumped straight into CSS, instead of needing to learn tables, and I really have to wonder how on earth people can think it's harder than tables. Apart from anything else, when I read CSS it makes sense. When I see a table-based layout site's code, it just makes me want to run away in fear.
As for the HTML to CSS thing, that's the whole point, isn't it? The actual source of the page is easier to understand because the style information is kept seperate from the page. If I want to look at how they lay something out, I can look in one place, if I want to see how they've written what they have, I look in another. I can't even think of why you'd want to see both together...?
Lach - 21st April 2003 03:34 - #
Simon, Mozilla's DOM Inspector shows the CSS style rules (including whatever the default html.css styles) are applied on an element. Clicking the 'Inspect Node' and then desired area will jump you to the node, and then using the top-right drop down menu will show the CSS Style Rules for the object. (You can also use the left menu to show the Style Sheets being referenced). Yet another reason why Mozilla rocks the casbah.
As far as designing with CSS goes... when I first started doing web design, it was with HTML 2 (before/during the Netscape/Wilbur fiasco). My first designs didn't use table based layouts at all - I believe Mosaic not having tables support was still an issue (although I was using spacer GIFs). I want to say that the technique originated at SGI and didn't get in full swing until sometime in '95, but a quick Google News search didn't turn up what I was looking for. Anyone have a link? Err, in any case, yes, most stuff in CSS is much easier and again, in most cases gives a lot more control.
But, having designed both before tables, and after tables (CSS only layouts since 1999), I think that for web page layouts, the way tables shrink-wrapped and related containers really is much more intuitive than CSS. That is to say, CSS2's visual formatting model (boxes, flow control, shrink-wrapping, layout control), especially for complex layouts [jello'd, columnar, etc.] is... err, flawed to say the least.
Not that either are ideal. Think about this. I want a way to say that for content block A, B, C, and D (in that order). There should be some CSS semantics to say that I want to create a columnar layout where block D touches the bottom of the page, and relative to set [A, B, C] is 50% of the width of the viewport, D on the left. D should have a minimum width of 300px and at no time should D and [A, B, C] overlap. D and [A, B, C] should be set within a 25px horizontal padding (within the viewport). Also, between each column, there should be at least a 1em gutter (but up to a 3em gutter). A should be at least 20em, and B and C should split the remaining distribution in a 60%/40% ratio, the containers should be able to belong in the page flow (or act like it) and the containers should never wrap.
When you write it out like that, I suppose it's a semi-complex layout, but nothing out of the ordinary that a page designer wouldn't need or want to do in the course of a normal design. Now, as far as I know, this is impossible to do in CSS2. At the very least, it's a nightmare scenario (despite the fact that stuff like this is really common). It is possible to do with tables, albeit with a lot of nested code and reordering the blocks. Ideally you'd like a style language that would let you specify without needing to have any container code beyond the A, B, C and D blocks [and let you leave it in that layout]. (I didn't specify real unit subtraction or relational element sizing because tables can't handle that either, but the 'ideal' styling language should probably be able to handle that as well).
(disclaimer: this may not be well thought out. also, this could be done with the CSS2 table box model, although according to the spec, the
displayproperty is optional)leonard - 21st April 2003 05:59 - #
Tim Parkin - 21st April 2003 10:04 - #
Like Stuart, I spent a few hours writing a computed styles bookmarklet instead of doing something useful, such as sleeping.
Features:
Jesse Ruderman - 21st April 2003 16:15 - #
Tim Parkin - 21st April 2003 17:34 - #
pixy - 23rd April 2003 13:29 - #
Please show me working CSS and I will believe in CSS. I have a 3 column display, I want the first column to be 150pixels wide BUT if the content happens to be 160pixels wide I want the column to expand to fit the content and I want all the sub contents to expand as well. TABLES do this, CSS doesn't (or so far I have not been able to find an example that doesn't fail as soon as I try content that happens to be too large.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html>
<head>
<style>
.csstable {
float: left;
width: 150px;
background-color: #EEE;
}
.csscell {
border: solid 1px #000;
width: 100%;
}
</style>
</head>
<body>
<div class="csscolumn">
<div class="csstable">
<div class="csscell">test1</div>
<div class="csscell">test2withcontentthatdoesnotfitinsp ecifiedspace</div>
<div class="csscell">test3</div>
</div>
</body>
</html>
vs
<html><body>
<table width="100" border="0">
<tr><td><table border="1" WIDTH="100%"><tr><td>test1</td></tr></table></td>< /tr>
<tr><td><table border="1" WIDTH="100%"><tr><td>test2withcontentthatdoesnotfi tinspecifiedspace</td></tr></table></td></tr>
<tr><td><table border="1" WIDTH="100%"><tr><td>test3</td></tr></table></td>< /tr>
</table>
</body></html>
Gregg Tavares - 11th August 2003 05:38 - #
I too, have only just started learning how to write HTML and CSS, and I find it very frustrating that having gone to all the effort of creating standards compliant code (see http://www.villagefabrics.co.uk (currently only some pages validate - I need to fix the others))it fails to display correctly in IE. I have plenty of people telling me it looks fine in other browsers, but that doesn't help me when I know that my customers are going to be using IE.
I'm resisting using tables - as has been suggested to me as a way to get round IE's bugginess, because tables frighten me - I've never used one in my life, not to mention the accessibility problems they create.
Karen McAtamney - 3rd January 2004 23:25 - #
Rick E Sim - 2nd March 2005 22:20 - #