开发者

Is there an advantage to using the XHTML 1.1 doctype with the "text/html" MIME type instead of an HTML doctype?

XHTML 1.1 is intended to be used with the "application/xhtml+xml" MIME type. Yet almost no one does this, because IE doesn't handle the "application/xhtml+xml" MIME type correctly, and draconian error handling is seen as being unfriendly to users.开发者_运维百科

If our site is stuck with the "text/html" MIME type, is there any advantage to using the XHTML 1.1 doctype over HTML4 or HTML5?


See this 8-year-old discussion of this very topic, which leads to this in-depth article. In short: there are disadvantages to doing so. Do not do it.

The executive summary, from the article:

If you use XHTML, you should deliver it with the application/xhtml+xml MIME type. If you do not do so, you should use HTML4 instead of XHTML. The alternative, using XHTML but delivering it as text/html, causes numerous problems that are outlined below.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜