我相信这里的每个人都知道我们无法在不破坏IE兼容性的情况下为XHTML提供正确MIME类型(application/xhtml + xml)的页面,并且任何浏览器都会将任何使用text/html提供的内容解析为HTML那里.因此,如果内容未被解析为XML.
我使用xhtml doctype只是出于一个原因:与html相比,它帮助我以更严格的方式在我的标记中找到"错误".即使我的文档作为text/html提供
Is there any other benefit to use XHTML 1.0 Strict with content="text/html; over HTML 4.01 strict at all? At present or and in the future.
None. You don't get any of XHTML's benefits. As far as the browser is concerned, it's getting weird HTML, not XML. If you want to get the benefits of XML, like extensibility and the stricter parser (if that's a benefit), you have to serve your page as application/xhtml+xml, and IE won't support it. Not to mention XHTML 1.0 is incompatible with 2.0, while HTML will always be future proof.
You may want to read this, among many others. In short, only use XHTML if you know you need to, otherwise it's useless.
XHTML also doesn't necessarily mean that the browsers will adjust to standards. Don't worry about the Standards vs Quirks mode stuff, it's something that has be mantained for backwards compatibility. When a browser encounters a page with a doctype (any doctype, HTML or XHTML), it will try to render it according to standards. It doesn't mean that it will render it just like the W3C says, it just means that it will try to (and maybe not succeed).
| 归档时间: |
|
| 查看次数: |
347 次 |
| 最近记录: |