# 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.

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.

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.

## 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.

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

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.

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:

• 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模式之前的所有操作。

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

• 0
点赞
• 0
评论
• 0
收藏
• 扫一扫，分享海报

01-05

03-08 15
02-15 511
05-27 11万+
02-26 57
10-29
12-20
07-10
07-03 2万+
08-28 743
07-05 172
05-13 7796