• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com专业计算机教程网站
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure
您的位置:首页 > 网页设计 >心得技巧 > IE8兼容视图(IE7 mode)与独立IE7的区别详解

IE8兼容视图(IE7 mode)与独立IE7的区别详解

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-08-06

本文主要包含IE8,兼容视图等相关知识,佚名 希望在学习及工作中可以帮助到您

一. IE8兼容视图概述
为了解决新版浏览器不兼容旧网站的问题,IE8浏览器增加了一种叫做“兼容性视图”的功能,可以让网页以IE7的代码规范来显示,这样,就能够很好的解决大部分(但不是全部)由于代码标准不一致引起的网页问题。
二.“浏览器模式”和“文档模式”之间的区别
兼容性视图涉及两个重要的功能便是“浏览器模式browser mode”和“文档模式document mode”,在IE8中按F12键,打开“开发人员工具”,在菜单栏中可以看到“浏览器模式”和“文档模式”的切换菜单,其中可以选择切换到IE7/8等不同的网页模式。
那“浏览器模式”和“文档模式”之间有什么区别呢?
“浏览器模式”用于切换IE针对该网页的默认文档模式、对不同版本浏览器的条件备注解析、发送给网站服务器的用户代理(User-Agent)字符串的值。网站可以根据浏览器返回的不同用户代理字符串判断浏览器的版本和安装的功能,这样就可以向不同的浏览器返回不同的页面内容。
默认情况下,IE8的浏览器模式为IE8。用户可以通过单击地址栏旁边的兼容性视图按钮来手动切换到不同的浏览器模式。在IE8中,IE8兼容性视图会以IE7文档模式来显示网页,同时会向服务器发送IE7的用户代理字符串。
“文档模式”用于指定IE的页面排版引擎(Trident)以哪个版本的方式来解析并渲染网页代码。切换文档模式会导致网页被刷新,但不会更改用户代理字符串中的版本号,也不会从服务器重新下载网页。切换浏览器模式的同时,浏览器也会自动切换到相应的文档模式。
一般来说,两者都要设置为同样的版本,但是,如果不同又如何呢?或者说两者是否有优先级区别呢?
请看下面的msdn帖子:Just The Facts: Recap of Compatibility View
http://blogs.msdn.com/b/ie/archive/2009/02/16/just-the-facts-recap-of-compatibility-view.aspx
精华摘抄:
•We’ve evangelized use of the X-UA-Compatible tag to websites unable to update to support IE8’s Standards mode. The tag allows a web author to declare the exact standards mode behavior for which their website works best – IE8 Standards (again, the default when no header is present) or IE7 Standards. For example, using the value ‘IE=EmulateIE7’ causes IE8 to display a website “as IE7 would have”.
•We’ve provided end-user and corporate / IT mitigations to the website compatibility problem under the umbrella term ‘Compatibility View’. ‘Compatibility View’ allows IE8 users to have a great experience even when visiting websites that haven’t yet performed either of the above two steps. It also helps IT organizations preserve compatibility with the large number of line-of-business websites that are Internet Explorer 7 capable today.
•Compatibility View and the X-UA-Compatible tag are not equivalent. Compatibility View is something you do on the client. It affects three things: the User Agent string, the Version Vector (used in evaluation of conditional comments), and what mode DOCTYPEs that trigger Standards map to – IE8 Standards or IE7 Standards. The X-UA-Compatible <META> tag / header is something you use in page content / server-side and, when present, completely overrides Compatibility View settings on the client. It affects two things: the Version Vector and what mode DOCTYPEs that trigger Standards map to. It can’t affect the UA string as it’s already too late to change that – the client’s already made the GET request to the server (and it contains a UA string). What this means to developers is that if your site pivots on the User Agent string, adding just the X-UA-Compatible tag (to cause IE8 to display your site in IE7 Standards mode) won’t make your website compatible – you’ll also need to update your User Agent string detection logic as well.
总结,有两种方式可以使IE8兼容IE7模式,一是在服务器端,通过程序员控制修改网页的文档模式document mode,也就是通过Meta(X-UA-Compatible IE=EmulateIE7), 强制使页面变为兼容IE7的页面。
如下:

Compatibility View renders the page as if it was Internet Explorer 7 (including Javascript). There are a

您可能想查找下面的文章:

  • 让IE6、IE7、IE8支持CSS3的圆角、阴影样式
  • IE8兼容视图(IE7 mode)与独立IE7的区别详解
  • 让你的网站IE8浏览自动用IE7兼容模式

相关文章

  • 2017-08-06网页改版的7大要素分享 网页改版有哪7大要素
  • 2017-08-06浏览器缓存相关http头尽量减少http的请求次数
  • 2018-08-23轻松看懂规范!详解组件控件结构体系之引导类
  • 2018-08-23进阶学习!视觉设计中的11个经典的视错觉现象
  • 2017-08-06HTML标签及基本元素学习总结
  • 2017-08-06网页制作绝对路径与相对路径的区别
  • 2017-08-06页面重构技能-Javascript、CSS篇
  • 2017-08-06爱上朴实的CSS细节虽不起眼可提高效率
  • 2017-08-06前端开发工程师和美工对于网站开发所掌握的知识的区别
  • 2018-08-23表格行高如何设定?来看腾讯设计师的总结!

文章分类

  • html/xhtml
  • html5
  • CSS
  • XML/XSLT
  • Dreamweaver教程
  • Frontpage教程
  • 心得技巧
  • bootstrap
  • vue
  • AngularJS
  • HBuilder教程
  • css3
  • 浏览器兼容
  • div/css
  • 网页编辑器
  • axure

最近更新的内容

    • Airbnb团队负责人:硅谷新兴的产品内容策略分析师是什么
    • 网页自动刷新与自动跳转示例代码
    • 【推广】设计创业者| 为了提高过稿率,我换了台可以解决吐槽的笔记本
    • 今年都在学!聊聊有关服务设计的10种工具(方法+案例)
    • css技巧收藏——经典中的经典
    • 这些悬浮动效的常见玩法你都知道吗?
    • 口碑炸裂的《一出好戏》,电影海报也超棒!
    • 为了让 iPhone X 更好浏览网页,我给网页加了个导航按钮
    • 一直进化的扁平化设计,在2017年这么玩儿
    • 超全面!一个完整的交互设计稿有哪些必备元素?

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有