The new font tag
Inside the Lines
One of the toughest things to do each week is responding to emails sent from the Godbit Project contact form. It is surprising how many people still don't "get it" when it comes to web standards and CSS. Often times, the sites that are submitted for gallery consideration are beautiful because of great attention to detail in design, yet the code is terrible. The atrocities range in severity, from all-out nested tables, to JavaScript pop-ups and framesets.
By now, we know that tables for layout are bad. Allow me to rant about another problematic trend I have been noticing as of late. I think that as CSS becomes more recognized as the gold standard, designers are slapping sites together with inline styles, and then calling them standards compliant. This is no more true than if I bought a bucket of the finest paint, and then threw it over the top of a vintage sports car, pretending it was a vehicle restoration.
First, let me describe what I mean by inline styles. I would classify this as anything containing the phrase style="…"
within the body of an HTML document. Notice I said within the body and not the entire document. I believe that sometimes, and only in the case of examples, CSS can be put within the head of an HTML document. This was suggested awhile ago by Dave Shea.
Dreamweaver Dangers
That being said, I think that there are certain dangers in calling programs like Dreamweaver 8 "standards compliant," even if it has been hailed as such by SitePoint. Programs are just tools. If wielded by amateurs, they produce poor quality. If you rely only on the WYSIWYG view for your sites, Dreamweaver is going to spit out some pretty ugly CSS. The easiest way to tell if a site was done by a DW newbie is the abundance of code like: span class="style1"
.
This is not only non-semantic, it keeps all the code within the head of every single document, so your classes aren't even consistent throughout the entire site. Equally as bad is the aforementioned inline style
. I've seen things like table style="margin: 0 auto;"
in XHTML 1.0 Strict document types, which no longer allows for align="center"
. To me, this defeats the whole purpose of CSS. These people might as well give up and go back to using font
tags.
A few years ago, it seemed we were almost to the point where anyone could make a web site. "What you see is what you get" web tools that require no knowledge of HTML were becoming as ubiquitous as word processors and spreadsheet software. The problem: they were all based on a lie…
The above quote is from a Design in Flight article from over a year ago, and still the widespread problem of HTML misuse / abuse continues to perpetuate itself. It's a case of cyclical ignorance, through schools and design agencies that refuse to "grow up" and get in step with the pace of the industry. I think that Joe Clark said it best in his article entitled Failed Redesigns.
When teenagers' hobbyist blogs have better code than brand-new Web sites, somebody's doing something wrong. And that somebody is you, the developer. In a just society you would simply be fired; in an Orwellian society you would be sent to a reëducation camp. Failing either of those, you could at least read a book and upgrade your skills to a point where you are no longer a total laughingstock.
If those arguments haven't compelled you to separate CSS from HTML, then at least be aware that such sloppy coding methods will probably not be permitted in future standards set forth by the W3C(World Wide Web Consortium). According to one of their drafts, inline styles will not be allowed in the XHTML 2.0 specifications. The bottom line is: Adapt, or go back to whatever it is you did before the web.