简体   繁体   English

怪癖模式在2011年是否相关?

[英]Is quirks mode relevant in 2011?

With all the latest browsers like IE9, FF4, ever updating chrome, etc., do we still need quirks mode? 使用IE9,FF4等所有最新浏览器,不断更新Chrome等,我们还需要怪癖模式吗?

If yes where is it useful? 如果是,它在哪里有用? In which scenario? 在哪种情况下?

Quirks mode is designed to allow (much) older websites to work in (comparatively) newer browsers. Quirks模式旨在允许(更多)旧网站在(相对)较新的浏览器中工作。

New development should never be done in Quirks Mode, but Quirks Mode will stick around as long as there are still old un-updated websites that require it (ie, forever). 永远不应该在Quirks模式下进行新的开发,但只要仍有旧的未更新的网站需要它(即,永远),Quirks模式将保持不变。

No. You should never use quirks mode. 不,你不应该使用怪癖模式。 It ceased to be of any relevance once IE 5.0 and 5.5 stopped being used. 一旦IE 5.0和5.5停止使用,它就不再具有任何相关性。

Those were the last browsers which did not support standards mode, so any sites which needed to include support for them would have needed to be able to work in quirks mode. 那些是不支持标准模式的最后一个浏览器,因此任何需要包含对它们的支持的站点都需要能够以怪异模式工作。

However, IE6 along with all versions of all browsers released since then supports standards mode. 但是,IE6以及此后发布的所有浏览器的所有版本都支持标准模式。

Some of them still carry legacy support for quirks mode, but you shouldn't allow them to use it. 其中一些仍然支持quirks模式的遗留支持,但你不应该允许它们使用它。 (it's triggered if you neglect to include a <!DOCTYPE> at the top of your HTML code, which is why you shold always declare a doctype) (如果您忽略在HTML代码的顶部包含<!DOCTYPE> ,则触发它,这就是为什么您总是声明一个doctype)

In the unlikely event that you need to support IE5, then use quirks mode. 万一您需要支持IE5,请使用quirks模式。 Otherwise, avoid at all costs. 否则,不惜一切代价避免。

If you are maintaining code that uses quirks mode then you should take the time to convert to use standards mode. 如果您要维护使用quirks模式的代码,那么您应该花时间转换为使用标准模式。

If it's a public-facing website, then using quirks mode now should not even be contemplated, as it will look hideous in a lot of modern browsers. 如果它是一个面向公众的网站,那么现在甚至不应该考虑使用怪癖模式,因为它在许多现代浏览器中看起来很可怕。 Even if it's in a corporate environment then you I would strongly reccommend converting it to standards mode, as even IE6 users will benefit from that (if nothing else, it'll make their eventual upgrade to a newer browser less painful). 即使它在公司环境中,我强烈建议将其转换为标准模式,因为即使是IE6用户也会从中受益(如果没有别的话,它会让他们最终升级到更新的浏览器不那么痛苦)。 The only time you won't be able to use standards mode that is if you have a client who is still stuck with IE5. 唯一一次你将无法使用标准模式,如果你的客户仍然坚持使用IE5。 But if you've got that, then you should have run away screaming already. 但是,如果你有这个,那么你应该已经逃跑了。

Quirks mode is definitely still needed in corporate environments where legacy applications are very common. 遗留应用程序非常常见的企业环境中仍然需要Quirks模式。 That old 1998 webapp still works and we don't have money to replace it so it has to keep working. 旧的1998年webapp仍然有效,我们没有钱来替换它,所以它必须继续工作。

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

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