Thursday, January 05, 2006

W3C web validation

Valid XHTML 1.0 Transitional Valid CSS!

Today I revisited the meaning and significance of Document Type Declarations (DTD) which appears at the top of every web page.

Something like:
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

Browsers can display web pages in standards compliant mode (up to date) or Quirks mode (old fashioned). You need the correct DTD for your web page to look good, to display the modern XHTML and CSS that you have worked hard to implement.

One issue I looked at was whether to upgrade my XHTML 1.0 Transitional DTD to Strict or even to upgrade to XHTML 1.1 Declaration. I researched the XHTML 1.1 Declaration and found that:
All deprecated features of HTML, e.g. presentational elements and framesets, have been removed from this version (XHTML 1.1). Presentation is controlled purely by Cascading Style Sheets.
http://en.wikipedia.org/wiki/XHTML#XHTML_1.1
I tried this but when I ran it through the W3C validator found that it was too fussy for me. In particular, it objected to the target attribute in the anchor tag and I didn't know how to achieve the effect of opening a link in a new window (target="_blank")without using that. So I ended up sticking to XHTML 1.0 Transitional DTD, which is not too fussy.

My XHTML wouldn't validate without a UTF (Unicode Transformation Format)Declarion either, something like: < xml version="1.0" encoding="utf-8"? >

UTF-8 is the preferred encoding for web pages.

Finally, I also needed a name space declaration, something like:
< html xmlns="http://www.w3.org/1999/xhtml" >

There is an article at W3C, My Web Site is Standard. Is Yours? which repeats Jeffrey Zeldman's assertion that 99% of web sites are not valid.

I liked the section at the start of this document which responds to the common objections against web standards. There are nine rebuttals.

Today, I successfully validated my index.htm web page against both the W3C XHTML and CSS validators.

Why bother to validate? It provides me with the best chance for a good display of what I have produced in a wide variety of browsers. Secondly, valid XHTML and CSS is the best available platform for disability access. Finally, it enable for more (not less) creativity as some beautiful cutting edge CSS sites have demonstrated (Zen Garden, Eric Meyer).

And I like being able to put those W3C stickers at the bottom of my page.

1 Comments:

Anonymous Anonymous said...

congrats! now you are one of us ;) but i suggest you to find another sttickers a bit more elegant XD

9:07 PM  

Post a Comment

<< Home