订阅本站

让IE8兼容为IE7开发的网页

admin 发表于 2008-10-21 分类 知识口袋 | 发表评论

  刚刚安装了IE8 , 发现有一些网页打开以后与在IE7下显示的效果不一样了,有的变形很厉害。上微软网站仔细搜寻了一下找到了解决方法。

  IE8开发小组希望可以打造出IE8的"标准模式",比IE7的好很多很多的"标准模式",而且也是无限接近W3C的WEB标准的。

  总得来说,IE8默认将会以IE8的"标准模式"来处理网页,但仍将通过特殊方式对为IE7,IE6开发的网页提供兼容性支持,以让页面设计师可以平稳过渡到新版本浏览器的"标准模式"。基于微软的互动性政策,网页开发师可以在页面的header/meta标记里注明这是为哪个浏览器开发的,for IE7或者IE8,那IE8就会用IE7的"标准模式"来处理页面。

如何标记呢?请看下面:

  Using a simple meta declaration, we can specify the rendering engine we would like IE8 to use. For example, inserting this:

  1. <meta http-equiv="X-UA-Compatible" content="IE=8" />

into the head of a document would make IE8 render the page using the new standards mode. This syntax could be easily expanded to incorporate other browsers as well:

  1. <meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />

...

参考文章地址:http://blogs.msdn.com/ie/archive/2008/03/03/microsoft-s-interoperability-principles-and-ie8.aspx


无觅相关文章插件,快速提升流量