<分区>
<分区>
我的导航菜单在 IE 6、7 或 8 中不工作。我对它在 IE 6 中不工作没问题,但不幸的是它需要在 IE 7 和 8 中工作。我使用的是 Ubuntu,所以我有一直在使用 http://netrenderer.com 进行测试. nav div 没有向右浮动,并且 li 元素没有内联显示。为什么是这样? Here is the website .
nav ul {
margin: 0;
padding: 0;
}
nav a {
height: 20px;
width: 27%;
margin: 0 1.7%;
margin-bottom: 0;
padding: 25px 2%;
text-align: center;
text-decoration: none;
font-weight: thin;
color: #555;
float: left;
display: inline-block;
}
nav li:first-child a {
margin-left: 0;
}
nav li:last-child a {
margin-right: 0;
}
/* ========================
INTERMEDIATE: IE Fixes
======================== */
nav ul li {
display: inline;
}
nav {
display: block;
float: right;
width: 38%;
clear: both;
}
最佳答案
nav
标签在 IE 8 及以下版本中不受支持,要避免这种情况,只需包含一个 HTML5 填充程序,该填充程序将添加对那些损坏的标签的支持。尝试在 <head>
中添加这个您页面的部分:
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
关于html - 我的导航菜单不适用于 IE < 9,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15989174/