Choosing HTML or XHTML

Robert Nyman's post HTML or XHTML? discusses some of the differences between HTML and XHTML. The information may help you make an informed decision next time you're in a position to choose between using HTML and XHTML.

I agree with Robert here: using a Strict doctype is far more important than whether you use HTML or XHTML. Strict doctypes will help you separate content and structure from presentation, and will trigger full standards mode in web browsers that support doctype switching.

So, what do I use? It depends. 456 Berea Street is currently HTML 4.01 Strict. I used to use content negotiation to send XHTML 1.0 Strict as application/xhtml+xml to browsers that support it, and HTML 4.01 Strict as text/html to others. For various reasons, all browsers now get the latter.

Posted on November 4, 2005 in Quicklinks, (X)HTML