01/10/03
gettin' all strict
I’ve just changed the site from being XHTML Transitional to Strict, and I was surprised how little work was involved. What follows is a list of everything that didn’t validate, and had to be changed:
- remove target=”_blank” from <a> tags. Opening new windows breaks the back button anyway, which is an accessibility problem. You can always use a simple javascript to open new windows, which is what I’ve done for the desktops section
- remove border=“0” from <img> tags (use css instead – img {border:0} )
- add <fieldset> tags around form elements. (You can actually use p, h1 etc, to validate, but fieldset makes more sense.
- remove language=“javascript” from javascript tags
- change any remaining name=” “ attributes to id=” “
The last 2 were leftovers from the original Movable Type templates. In a matter of an hour the site was converted. The search and replace function within Movable Type meant I didn’t have to go through every entry individually.
Why bother? Well, apart from a chance to be even more anal, it was education. My reason for creating this site in the first place was to practice and try out new things. While it doesn’t mean I have a thorough understanding of all the nuances of the XHTML strict spec, I know more now than I did a few hours ago. (There may well be the odd entry page that doesn’t validate – let me know if you spot one.)
5
Tags: 


Previous





Download our vCard
wes said 1774 days ago:
Your front page doesn't validate. It appears to be in the unordered list in your article about how you went strict. Right at the end. Almost made it ;)(Jon - it does now! Thanks for spotting it Wes)
Andy Budd said 1774 days ago:
I use id instead of name these days. However when running a site thought DWMX2004 browser bug checker I came up with a bunch of error messages stating that the name attribute was required for input tags in Mozilla 1.0, Safari 1.0 and Netscape 7.0Go figure?
Jon Hicks said 1774 days ago:
I've sometimes used both as 'belt and braces' approach, but mostly I use id as well. All the name attributes were movable type leftovers.Is there a bug in the browser bug checker? Oh the irony...
Jeff Croft said 1773 days ago:
Wow, Jon...you've inspired me (and this is not the first time!). I think I'll make the switch, too. Sounds like it shouldn't be too much work, as I don't make a habit of using "target," "name," or "border," anyway. :)Thanks!
Jeff
Jon Hicks said 1773 days ago:
Jeff,A quick sneaky peak at your source code reveals a very neat and tidy markup. You shouldn't have many problems. In fact, it may only be stuff from MT.
Converting to XHTML strict can be seen as being anal and faddish for the sake of it. However, the whole point of XHTML is to ease the transition to XML. I see going all strict is another step towards that.
Good luck!