html - 我的导航菜单不适用于 IE < 9

标签 html css internet-explorer-8 internet-explorer-7 internet-explorer-6

<分区>

我的导航菜单在 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/

上一篇:html - 链接中的简单下拉菜单?

下一篇:javascript - 如何向当前 css 值添加新值

相关文章:

javascript - 延迟超链接

html - 从 Bootstrap 中的表顶部删除行

javascript - 使用 css 或 jquery 在子类上添加样式

javascript - 更改 :before selector from javascript

html - 自定义字体在 IE8 中呈现错误

html - 选择子标签时无法查看父标签的文本

html - 文本小部件中的图像始终位于不同的行中

jquery - 使用 css 和 jquery 将图像用作单选按钮

javascript - IE8之前内容不显示

html - Google 字体(上面有一个空格)无法在 IE7/IE8 上呈现