View Single Post
Old 2007-03-07, 08:16 AM   #7
jayeff
Just because I don't care doesn't mean I don't understand!
 
jayeff's Avatar
 
Join Date: Sep 2006
Posts: 95
Send a message via ICQ to jayeff
The separation of document layout from document structure has been discussed since 1990 when HTML first appeared. Tim Berners-Lee wrote his NeXT browser/editor to use a style sheet, but decided it was up to each browser to decide how to best display pages. For the next few years, the major browsers went backwards in terms of styling abilities as each sought to gain market share via proprietary implementations.

Ironically the first CSS working group which eventually led to the standards we use today, was formed in 1997. That was the same year that David Siegel published his book about HTML layout (using tables for data display) and everyone jumped on the bandwagon. A usable CSS standard which modern browsers could all handle (albeit with some differences in interpretation) did not appear for another 5 years.

CSS is not simply about doing away with tables. The fact is that document styling which has been common in the bricks-and-mortar world for hundreds of years and which is possible in even the simplest word processors, is just not available via HTML. Nor will it ever be, because it was recognized before the internet ever came along that it is hugely inefficient to store electronic documents with styling embedded in the content. So changes in future, now that there are usable CSS standards, will be to eventually eliminate even the few styling options which were built into HTML.

All of which is the first reason I find myself defending or promoting CSS at regular intervals. CSS+HTML isn't easier to learn than plain HTML, but nor is it any harder and thousands of hopefuls visit webmasters boards every year. It doesn't make sense for these newcomers to put time and effort into learning code which is inherently limited, instead of code which will let them do pretty much anything they can imagine.

My second reason is that after discussions about building traffic and which sponsors to use, making sites load faster and more search-engine friendly are high on the list of most popular board topics. There is something very flawed about people looking for clever tweaks in these areas, without getting the basics right first.

Simple logic says it is faster and cheaper to deliver lean code and we know that browsers have to work relatively hard to display tables. As far as search engines are concerned, much is guesswork, but it is not guesswork that they are looking for content and that code only gets in the way.

Finally, most code is rubbish. Every day I get asked to help solve layout problems and the first thing I suggest is validate existing code because often that will provide the answer. I don't recall even once seeing a clean site, the best have dozens of errors and most, hundreds. Compliant sites are not some abstract concept, but the best way to ensure that your visitors can all see what you intend them to see. That surely is a basic aim which any (commercial) webmaster should shoot for and a major side benefit of people switching to modern design standards is that many have also begun to routinely validate their code. The first site of mine I ever validated had more than an hundred errors, whereas now I'm disappointed if my first draft has even a handful. That improvement in my own knowledge has made my work faster and easier.

Yes, there are browser incompatibilities, but here's a heads up: not all are confined to the way that CSS is handled. Secondly, the number of gotchas is very small, they are all recognized and often avoidable. If not, widely known solutions exist. Does CSS somehow force people to check the correctness of their code and ensure its compatibility? Of course not, no more than HTML does, so certainly there will be sloppy coders in both camps. That's a reflection on the people, not on the code they use.

http://csszengarden.com/
http://www.hotdesign.com/seybold/

Last edited by jayeff; 2007-03-07 at 08:20 AM..
jayeff is offline   Reply With Quote