W3C XHTML Valid!

Last night I updated the code for my site and Davis Construction. From download, the rdc* theme is XHTML valid, but user error tends to change that. After doing some research, and using the validation tool from W3C, both sites are now valid ;-). In a nutshell, I geeked out last night.

One of the important maxims of computer programming is: Be conservative in what you produce; be liberal in what you accept.

Browsers follow the second half of this maxim by accepting Web pages and trying to display them even if they’re not legal HTML. Usually this means that the browser will try to make educated guesses about what you probably meant. The problem is that different browsers (or even different versions of the same browser) will make different guesses about the same illegal construct; worse, if your HTML is really pathological, the browser could get hopelessly confused and produce a mangled mess, or even crash.

Why validate?


Comments

  1. Quote

    Rock on, man! All of the stuff I hand code is XHTML compliant. On the other hand, some of my pages (web page exports out of iPhoto) are probably horrendously non-conformant, which brings me to this point–

    Maybe there ought to be an “anything goes” DTD.. you know:

    Followed by HTML like
    >img src=foo.gif">>/<>

  2. Quote

    Crap… I forgot to escape my DOCTYPE header… what you didn’t see in my previous comment was:

    &lt!DOCTYPE html PUBLIC “-//W3C//DTD YOUVE_BEEN_WARNED 1.0 transitional//EN”
    “http://www.w3.org/TR/2005/REC-thar_be_dragons_here-20051030/DTD/tags_with_no_end_brackets_are_legal.dtd”>

  3. Quote

    that’s a good idea for a DOC type. LOL!

Leave a Comment

(required)

(required)

Formatting Your Comment

The following XHTML tags are available for use:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

URLs are automatically converted to hyperlinks.

Preview: