此 CSS 中的哪些内容在 IE8 和 IE7 中不起作用?
nav {
position: fixed;
top:60px;
left:30px;
color:black;
float:left;
}
nav div#button {
width:205px;
height:50px;
text-align: center;
padding-top: 5px;
margin-bottom:10px;
font-size: 23px;
}
nav a {
color: #000000;
text-decoration: none;
}
nav div#button:active {
width:250px;
height:65px;
}
nav div#button.home {
background-color: #79b22c;
}
nav div#button.links {
background-color: #3b50cc;
}
nav div#button.aanbod {
background-color: #BA3BCC;
}
nav div#button.forum {
background-color: #1CAEB2;
}
nav div#button.contact {
background-color: #daa520;
}
它在 IE9 和 IE10 中运行良好。但是 IE8 & IE7 显示无样式文本。 我已经使用 browserstack 进行了测试。 谁能帮帮我?
最佳答案
<nav>
和其他 HTML5 元素是在 IE 7 和 IE 8 发布后定义的,因此浏览器不知道如何处理它们。
但是,可以指示他们处理它们。而且, html5shiv
可以帮助解决这个问题:
Include the HTML5 shiv at the top of your
<head>
in a conditional comment after any stylesheets.<!--[if lt IE 9]> <script src="html5shiv.js"></script> <![endif]-->
关于css - 为什么我的 CSS 不能在 IE 8 和 IE 7 中运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17589098/