这是我的 CSS:
.lt-ie8{
body{
display:none!important;
}
}
这是我的 HTML:
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
CSS 似乎没有正确定位 IE7,有人知道我哪里出错了吗?
最佳答案
这对我来说非常有效。
<html>
<head>
<title></title>
<style type="text/css">
.test{
background: green;
height: 100px;
width: 100px;
}
</style>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8">
<style type='text/css'>
.test{
background: red;
}
</style>
<![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
</head>
<body>
<div class="test"></div>
</body>
</html>
关于css - 在 CSS 中针对 IE8(更少)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16445765/