为什么不是';我的CSS不是在IE8和IE7中工作吗?
这个CSS中有什么在IE8和IE7中不起作用为什么不是';我的CSS不是在IE8和IE7中工作吗?,css,internet-explorer,internet-explorer-8,cross-browser,internet-explorer-7,Css,Internet Explorer,Internet Explorer 8,Cross Browser,Internet Explorer 7,这个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 {
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进行了测试。
谁能帮助我?尝试使用:
<!DOCTYPE html>
此外,您不需要:
div#menu
您需要#menu
在代码顶部,删除颜色,只使用背景,其他HTML5元素是在IE 7和IE 8发布后定义的,因此浏览器不知道如何处理它们 但是,可以指示他们处理这些问题。并且,可以在这方面提供帮助: 在任何样式表之后的条件注释中,在
顶部包含HTML5 shiv
<!--[if lt IE 9]>
<script src="html5shiv.js"></script>
<![endif]-->
位置:已修复ie7中不工作的问题。Use应该在css中使用expression()并将其置于绝对位置。
nav div#按钮
引起了一些关注。在您的标记中,有多少个元素具有id=“button”
?5个具有“id=“button”id的元素对于整个
文档中的单个元素应该是唯一的。您不应该有超过1个id=“button”
。如果需要在多个元素上重复使用,请改用class
名称--class=“button”
和class=“button home”
。nav
元素。标签是html5标签,它不能工作IE7,IE8…我能看看你的页面是什么样子的吗