I am currently converting the entire site to HTML 4.01 Strict. This means I will no longer qualify for the X-Philes. It has been a fun and interesting but frustrating journey.
Being a stickler for doing things “by the book,” I have been
?xml prologue in addition to serving
application/xhtml+xml to better browsers. Everything
was fine until I decided that I should also use the
?xml-stylesheet processing instructions
along with the
Every browser I checked handled it fine until I got to IE6/Windows, which tried
to render the page as generic XML. I was able to verify
this by saving a copy of the source code on my hard drive with a
.xml file extension.
Internet Explorer cannot render XHTML properly when served according to the W3C spec; its XML rendering mode left the page a terrible mess, with all of the links broken and the page useless (see screenshots below).
A lot of reading and research went into this. I realized that my reasons for converting to XHTML served “correctly” didn't hold water:
- Forward compatibility — I think HTML will be around for a long time, especially considering the number of tag soup pages out there today.
- Giving the best browsers what they want — that means giving invalid HTML to everyone else, since that’s how they parse it.
No more! I’m with Mark Pilgrim on this one: it’s dangerous. I’m with Hixie: it’s considered harmful and can possibly mislead less experienced authors. Don’t get me wrong: XHTML offers some great scripting possibilities, not to mention the extensibility of XML for those who need it (like Jacques Distler, who blends two namespaces). But until it’s well supported by the vast majority of the browsing public, I’m sticking with HTML 4.01 Strict.
Below are two screenshots
of the Petitt’s Creations home page on
Sunday afternoon, November 2, 2003, as rendered on
Internet Explorer 6.0 running on Windows 98 Second Edition. The page
was delivered to the browser as
text/html in both cases,
but the browser read the
instructions and tried to render the page as generic XML, with disastrous
results. In the first case, the main style sheet was linked to
externally; in the second, it was imported through a
element in the page source which was then linked to by an
attribute. Apparently, IE
couldn’t find the style sheet using this method and so rendered
the page as plain unformatted text.
Each image is a link to a text document containing the corresponding page source. IE users will need to select View > Source from the menu because the browser may try to render the text document as XML.