Andy N
Andy N

Reputation: 1123

Does html5 render page differently if previously coded for XHTML transitional doctype?

We have all our sites using the xhtml transitional doctype. Would just like to use the html5 doctype. Just wondering if anyone notice any rendering differences when switching. I am really just concerned about the older browsers such as IE 6. Will not be using any of the new html5 tags for now. Will the xhtml way of closing tags with /> break anything in html5?

Upvotes: 0

Views: 279

Answers (1)

You
You

Reputation: 23774

TL;DR: No, it won't.


There are basically two ways to go here, depending on what your XHTML looks like at present and how you're serving it. If you really are serving it as XHTML (application/xhtml+xml) and feel a pressing need to continue using an XML-based format (perhaps you're generating the content using some XML tool), you should use the XML serialization of HTML5 and consequently no Doctype at all (but keep in mind that this requires you to have valid XHTML and serve it as such).

If you don't have to use and XML-based format (which you probably don't unless you're using an XML tool to generate it), you should be using regular HTML5 which may allow self-closing element in certain circumstances, which means tag soup shouldn't cause any problems.

Now, in the case of IE6, which can't parse HTML5 or XHTML properly, there won't be any difference at all. It will still think your document is HTML 4.01 (just as it does when you send your XHTML document as text/html) and parse it the exact same way as it does now, assuming the current doctype triggers standards mode.

Upvotes: 2

Related Questions