« Typepad or Movable Type? | Main | How to Make Money with Your Blog »

W3C Validation Service

Has it ever happened that you make a change to your default templates or stylesheet and suddenly your weblog doesn't look right anymore? Panic begins to set in as you quickly try to undo the changes that you just made, but it's still not working? A great tool to use to help troubleshoot problems like this is the W3C Markup Validator.

valid-xhtml10.png

The World Wide Web Consortium (W3C) is the organization responsible for setting the HTML specifications and standards that browser developers use in their web browsers. If your web page "validates" then it should be able to be viewed properly in the major web browsers. If it doesn't validate, then the validator tool will list out all of the errors or inconsistencies of your code with the Doctype of HTML you are using, which in the case of Movable Type is XHTML 1.0 Transitional.

The most likely culprit for a screwy looking page is a div tag <div> that is missing its closing tag </div>. The validator can help you locate those errant div tags. The validator may also list a whole bunch of errors that are somewhat trivial; for example it doesn't like <br> line break tags, they need to be written like so: <br />. The validator is also picky about blockquotes. You have to make sure there is a blank line preceding a starting blockquote tag on a page for the page to validate.

Some people seem to get religious over having their pages validate. My view is that some pages will never validate, yet look perfectly fine in 99% of the browsers out there, so don't get too hung up on having to have every page validate. The validator is a great tool for troubleshooting, and a good place to start if your pages aren't rendering properly. The W3C also has a CSS Validator for making sure your stylesheet doesn't have any glaring errors or omissions.

Links:
W3C Markup Validator
CSS Validator
Al-Muhajabah's MT tips: a tool for validation - a great explanation of the validator.
Amputator plugin - converts ampersands to conform to valid XHTML.
Saferef plugin - searches for non-valid URLs and fixes them.
Validable plugin - "helps you create a validatable site even when your sloppy writing style and MT's line break conversion conspire against you."
March to Your Own Standard - a case against validation fundamentalism.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)