简体   繁体   English

为什么XHTML 1.1 doctype触发怪癖模式?

[英]Why does the XHTML 1.1 doctype trigger quirks mode?

I'm not using the XML declaration <?xml version="1.0" encoding="UTF-8" ?> 我没有使用XML声明<?xml version="1.0" encoding="UTF-8" ?>

I'm only using this DTD as a first thing in a page? 我只是将此DTD用作页面中的第一件事? which has no problem rendering in strict mode. 在严格模式下渲染没有问题。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

It validated as quirks mode with this site http://vesa.piittinen.name/doctype/ 该网站已通过http://vesa.piittinen.name/doctype/验证为怪异模式

(I can't give the link to the site on which I'm working) (我无法提供指向我正在工作的网站的链接)

In IE 6 it shows almost standards mode , and in FF it shows full standards mode . 在IE 6中,它显示了几乎标准模式 ,而在FF中,它显示了全标准模式

Should I change my doctype to get the same rendering in all browser? 我是否应该更改文档类型以在所有浏览器中获得相同的渲染?

I'm having a rendering problem in a site 我在网站上遇到渲染问题

Your doctype is fine.. 您的文档类型很好。

The problem lies with a specific bug (IE6 double margin on floated elements) you are dealing in your other post.. See there for an answer to the problem .. 问题在于您在其他帖子中正在处理的特定错误(IE6浮动元素上的双重保证金)。请参见此处,以获取问题的答案..

Based on the documentation on that site: 根据该站点上的文档:

Internet Explorer 7 and 6 don't have a real non-quirks mode, it is similar to the limited quirks mode of the other browsers. Internet Explorer 7和Internet Explorer 6没有真正的非怪癖模式,它类似于其他浏览器的受限怪癖模式。 IE 5.5 and before only have a quirks mode. IE 5.5及更低版本仅具有怪癖模式。

It is because the author is letting his dislike of Internet Explorer stop him from using the accepted terminology for the rendering modes of that browser. 这是因为作者让他不喜欢Internet Explorer的原因阻止了他将公认的术语用于该浏览器的呈现模式。 IE6 Standards/Strict Mode isn't "good enough" so he calls it "Limited Quirks Mode" IE6标准/严格模式还不够“完善”,因此他将其称为“有限怪癖模式”

Check here: 在这里检查:

http://www.quirksmode.org/css/quirksmode.html 1 - this is the right link. http://www.quirksmode.org/css/quirksmode.html 1-这是正确的链接。

Check the Compatibility Master Table. 检查兼容性主表。 Do you HAVE to make it work for IE6? 您是否已使它适用于IE6? I would suggest trying to convince the client that IE6 is not a browser to use. 我建议尝试说服客户IE6不是要使用的浏览器。

Aside from that, use 4.01 Strict and make sure you validate you pages. 除此之外,请使用4.01 Strict并确保您验证页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM