Browers Meta Tag X-UA-Compatib...
Posted by Kevin | Filed under HTML/CSS/JS | 2009-01-29
打开浏览器查看liupeng.us的页面源代码,细心的朋友会发现meta信息里面多了个tag标签
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Language" content="utf-8" />
- <meta http-equiv="x-ua-compatible" content="IE=7" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta content="关注WEB标准,用户体验,关注前端技术,网页设计师,前端开发工程师,liupeng,Beijing China" name="keywords" />
- <meta content="关注WEB标准,用户体验,关注前端技术,网页设计师,前端开发工程师,liupeng,Beijing China" name="description" />
- <meta content="SaBlog" name="copyright" />
里面多了一句
- <meta http-equiv="X-UA-Compatible" content="IE=7" />
X-UA-Compatible 是什么?
看看MSDN上的资料说明:
主要意思我总结一下:
X-UA-Compatible是针对ie8新加的一个设置,对于ie8之外的浏览器是不识别的,这个区别与content="IE=7"在无论页面是否包含<!DOCTYPE>指令,都像是使用了 Windows Internet Explorer 7的标准模式。而content="IE=EmulateIE7"模式遵循<!DOCTYPE>指令。对于多数网站来说,它是首选的兼容性模式。
目前IE8尚在测试版中,所以为了避免制作出的页面在IE8下面出现错误,建议直接将IE8使用IE7进行渲染。也就是直接在页面的header的meta标签中加入如下代码:
- <meta http-equiv="X-UA-Compatible" content="IE=7" />
这样我们才能使得页面在IE8里面表现正常!
在为
安装了
