如何让css兼容IE7,IE8?

如题所述

第1个回答  2011-06-28
<head></head>之间

<!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="X-UA-Compatible" content="IE=7" />
加在这里
<title>无标题文档</title>
</head>

X-UA-Compatible是针对ie8新加的一个设置,对于ie8之外的浏览器是不识别的,这个区别与content="IE=7"在无论页面是否包含<!DOCTYPE>指令,都像是使用了 Windows Internet Explorer 7的标准模式。而content="IE=EmulateIE7"模式遵循<!DOCTYPE>指令。对于多数网站来说,它是首选的兼容性模式。本回答被提问者采纳
第2个回答  2011-06-28
可以在<head></head>之间加上
<meta http-equiv="X-UA-Compatible" content="IE=7" />追问

这个早就试了不管用

相似回答