Comments Upon

Valid XHTML (HTML)

What is validation really for?

Validation isn't something worth wagging fingers over, however it is extremely useful in a production environment.
mikeindustries.com

Valid XHTML is to the user no different than invalid XHTML as browsers are designed to handle errors within the code. The real benefits of valid code come into play when pages do break as and when new code components, content and sections are added, being an essential first step in troubleshooting.

If you know that your template is error free and the content is correctly marked up and encoded properly any errors thrown up by a validation tool will be the only errors listed. This enables us to identify and solve problems in a far shorter time frame than if hundreds of minor errors are listed together with the possible one problematic issue.

Being able to eliminate some guesswork on the way to a solution and the resulting time saving is reason enough to write valid code.

I've made the decision to write valid XHTML to future proof the code I create. I could write html 4.01 and still create valid functional code, however working with legacy systems on a regular basis I feel that as far as possible I should write code that complies to the latest specifications to avoid future problems and inconsistencies.

However I must admit, as of writting I've never come across a problem which has been solely down to invalid markup or CSS. More regularly the issues are caused by browser inconsistencies.

As a quick list here's a comparison of the benefits that are generally agreed to be present when using valid code and a few myths that need to be dispelled.

Fact Fiction
These thouhts last updated on
  • Cleaner, more logical markup
  • Superior cross-browser, cross-platform and future compatibility
  • Allows the use of CSS with greater cross-browser confidence and control
  • Improve search engine visibility
  • Valid code is possible in plain html as well as XHTML (both require a full DOCTYPE)
  • Allows the use of DOM scripting upon a web page, in the confidence that scripts will act in a predictable way
  • It's a standard and so has all the benefits of a standard product
  • Creates accessible web pages (it can help, but also hinder read why here)
  • Is the only way to write a web page
  • Is only possible when using XHTML
  • You have failed if a page dose not validate
  • Is the only way to provide content to mobile devices

This is my online portfolio, showcasing work created in the seven years I've been a graphic and web designer.

I also use the site as a development area where ideas and techniques are explored and commented upon.