Yesterday the World Wide Web Consortium published a working draft called Specifying the Language of Content, after reading it I finally decided to change some of my pages from being coded according the the XHTML 1.1 standard to XHTML 1.0 Strict. I did this because of accesibility reasons: In XHTML 1.1 it is only allowed to specify the language of your content by using the xml:lang
attribute.
The problem with this attribute is that most browsers (with the exception of Opera, I think) do only interpret the xml:lang attribute when the document is served as an XML document with a MIME type such as application/xhtml+xml (a way to accomplish this on my server is using the file suffix .xhtml instead of .html). The problem with serving pages as XHTML pages as XML is that in most cases the layout doesn’t work anymore.
However, most browsers, screenreaders, etc. can handle the lang
attribute which is a valid attribute in XTHML 1.0. Therefore I switched. As recommended I am now using both the xml:lang
and the lang
attributes to declare the text’s language. This has the additional pleasant side effect that quotes are now automatically displayed according to the respective language’s standards. Not by Internet Explorer though, which doesn’t handle the quote
element at all. Which is another reason to .
Tags: HTML
On a related note, beginning February 5th 2005, this blog is served with the correct MIME type to those browsers which can interpret it correctly (that means almost any modernish browser – and therefore it doesn’t mean the abominable Internet Explorer).>