ie浏览器开发比谷歌浏览器_跨浏览器开发:处理IE

ie浏览器开发比谷歌浏览器

I compare developing for Internet Explorer to growing up in a mental asylum. If you were born in an asylum, you would grow up talking to people who believed they were Napoleon, and that bugs were constantly crawling out of the walls. In that context, the conversations you had with the inmates would make a kind of sense. Once outside the grounds of the asylum however, sudden outbursts of “Green ideas leak from the sky! Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!” would be met with confusion and incredulity by the generally sane populace, making communication very difficult.

我将为Internet Explorer开发与在精神病院长大相比。 如果您是在庇护所出生,那么您会长大后与认为自己是拿破仑的人交谈,并且臭虫不断地从墙上爬出来。 在这种情况下,您与囚犯的交谈会很有道理。 但是,一旦离开庇护所,“绿色理念”的突然爆发便从天而降! Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn!” 一般的理智的人们会感到困惑和怀疑,使沟通变得非常困难。

Developing for IE only is living in that madhouse and constantly having that conversation. It’s a far better experience to grow up in the outside world, learning how to talk rationally, using standards, and then go into the madhouse and try to make sense of what is happening there.

仅为IE进行开发就生活在那个疯狂的地方,并且不断地进行对话。 在外部世界长大,学习如何理性地交谈,使用标准, 然后进入疯人院并尝试弄清那里正在发生的事情,这是一种更好的体验。

So my suggested web development workflow is this: develop for a standards-aware browser first. It doesn’t particularly matter which: I prefer Firefox, but Safari, Chrome or IE10+ could work equally well. Then take your work and look at it in earlier versions of IE.

因此,我建议的Web开发工作流程是:首先开发支持标准的浏览器。 哪一个并不重要:我更喜欢Firefox,但Safari,Chrome或IE10 +可以同样出色地工作。 然后开始工作,并在IE的早期版本中进行研究。

IE的问题 (IE’s Issues)

Microsoft’s ongoing development of Internet Explorer is continuing to improve the browser to meet web standards. While it was a great browser when it was introduced, from a historical perspective the standards that IE6 misinterpreted, corrupted or ignored were legion. These deficits were inherited by IE 7, 8, 9. Recently, IE 10+ has attempted to make a clean break, and has made a much better job of supporting standards.

微软正在进行的Internet Explorer开发正在继续改进浏览器以满足Web标准。 虽然它是一个很棒的浏览器,但从历史角度来看,IE6误解,破坏或忽略的标准是众多的。 这些缺陷是IE 7、8、9继承的。最近,IE 10+试图彻底突破,并且在支持标准方面做得更好。

You can get some idea by using IE to visit pages designed to test a browser’s conformance to web standards, such as the Acid 2 and 3 tests, or HTML 5, or looking at the incompatibility tables (and associated solutions) on websites such as quirksmode.org and positioniseverything.net

您可以通过使用IE来访问旨在测试浏览器是否符合Web标准(例如Acid 23测试或HTML 5)的网页 ,或者查看网站上的不兼容表(及相关解决方案)(例如quirksmode ),来获得一些想法.orgpositioniseverything.net

My goal here is to provide answers to some of the most common problems.

我的目标是为一些最常见的问题提供答案。

Broadly speaking, your goal in developing web pages for IE 7 - 9 is to retain the browser in “hasLayout” mode. hasLayout is somewhat arbitrary state for Internet Explorer, representing its early efforts to follow some web standards. This is an attempt – indeed, following all the rules can nonetheless jump IE out of hasLayout and into the dreaded “Quirks” mode, which means that the browser basically follows its own internal rules and lays your page out however it wants. And even when it is well-behaved, IE doesn’t always follow the rules as it should… but retaining hasLayout mode is better than nothing.

概括地说,为IE 7-9开发网页的目标是将浏览器保持在“ hasLayout”模式下。 对于Internet Explorer, hasLayout在某种程度上是任意状态,表示其遵循某些Web标准的早期努力。 这是一种尝试 –实际上,遵循所有规则仍可以使IE从hasLayout跳入可怕的“ Quirks”模式,这意味着浏览器基本上遵循自己的内部规则,并按需要布置页面。 即使行为良好,IE也不总是遵循应有的规则……但是保留hasLayout模式总比没有好。

A sample of what IE 7 - 9 don’t do:

IE 7-9 执行的操作的示例:

  • No support for CSS3, at all (although you can trick IE into doing some CSS3-like things with its own proprietary filters).

    完全不支持CSS3(尽管您可以诱使IE使用其自己的专有过滤器来做一些类似CSS3的事情)。
  • Little support for CSS2, at least up to IE8. So no :first-child, etc.

    几乎不支持CSS2,至少不支持IE8。 所以没有:first-child ,等等。

  • IE 6 and 7 have no support for display: table or related display properties

    IE 6和7不支持display: table或相关显示属性

  • No understanding of HTML5 until IE 9 (and even then only partial), although earlier versions of IE can be tricked into a superficial support of the specification

    直到IE 9才了解HTML5(甚至只有部分),尽管IE的早期版本可能会被欺骗为对该规范的肤浅支持。
  • No support for alpha transparency on PNGs until IE8.

    IE8之前不支持PNG的alpha透明性。

The following bugs and problems are (mostly) constrained to IE6:

以下错误和问题(大多)仅限于IE6:

  • Broken box model – the width of elements is calculated differently in IE6

    折线盒模型–元素的宽度在IE6中的计算方式不同
  • Double margin bug

    双重margin错误

  • No awareness of min- or max-width

    min-max-width

  • “Stepdown” on floated elements

    浮动元素的“降级”
  • Anything before DOCTYPE triggers Quirks mode.

    DOCTYPE触发Quirks模式之前的所有操作。

翻译自: https://thenewcode.com/92/Cross-Browser-Development-Dealing-With-IE

ie浏览器开发比谷歌浏览器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值