Some thoughts on Web Standards
August 30th, 2007
Today I’m on the way to renew my blog. One question that I ask me is: Should I use HTML 4.01 Strict or XHTML 1.0 Strict? To decide this I currently look thought blogs and web pages of well known web standard gurus.
On 456 Berea Street I read the following on the Accessibility Page:
This site is built on valid HTML 4.01 Strict for structure and CSS for presentation.
A modern web browser like Firefox, Safari or Opera is needed to make the most out of this site, but thanks to the separation of content and presentation it should be accessible to any browsing device, including Internet Explorer.
Take this as the funny part of this post. Now I’m going into the silly HTML vs. XHTML discussion.
HTML 4.01 Strict?
So the real cracks use HTML 4.01 Strict today even if they used XHTML in the past. The key point choosing XHTML is senseless today is that you have to deliver (X)HTML pages as text/html because the famous Internet Explorer doesn’t understand application/xhtml+xml. But if you deliver as text/html all browsers interpret your nice XHTML as tag soup anyway. Thats why some of the people caring about this stuff switched back to HTML.
After playing some time with Wordpress and its Themes/Plugins I realized that it is not simple to switch to HTML 4.01 Strict. The whole Wordpress world uses XHTML 1.0 and every single peace outputs /> instead of > on empty tags. So without rewriting nearly all Wordpress code, it would not be possible to generate real valid HTML.
The other fact that pushes me towards XHTML is a article of Christoph Schneegans which reads XHTML oder HTML?. He says that a HTML Validator wouldn’t complain about valid SGML shortcuts which can cause rendering errors in browsers. To cite him - this markup is perfectly valid HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><><title//<p ltr<span></span</p></>
and it is equivalent to:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head><title></title><body><p dir="ltr"><span></span></p></body></html>
To summarize: I will use XHTML 1.0 Strict delivered as “text/html” for now and maybe (X)HTML5 later on in some years.