gpt4 book ai didi

html - 我的导航在 Internet Explorer 上不起作用

转载 作者:行者123 更新时间:2023-11-28 17:23:03 25 4
gpt4 key购买 nike

下面的代码片段在 Chrome 和 Mozilla 浏览器中运行良好,但在 IE8 上我只看到一个没有设计的低估列表——有下面的 HTML 和 CSS 代码,我不确定为什么。有什么想法吗?

    nav {
background-color: #666;
height: 50px;
text-align: center;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;

}
nav ul {
list-style: none;
display: inline-flex;
padding: 0;
margin: 0 auto;
}

nav ul li {
display: inline;
margin: 0 auto;

}

nav a:link, nav a:visited {
color: #FFF;
display: inline-block;
padding: 15px 25px 15px 25px;
height: 20px;
font-size: 20px;
text-decoration: none;
font-family: gothic;
}

nav a:hover, nav a:active,
nav .active a:link, nav .active a:visited {
background-color: #5aada0;

}
    <div class="container">
<nav>
<ul>
<li><a href="index.html">home</a></li>
<li><a href="about.html">about</a></li>
<li class="active"><a href="#">contact</a></li>
</ul>
</nav>
</div>

最佳答案

IE8 不支持 HTML5,因此您不能使用 <nav>标签。

用这样的东西替换你的导航标签:

<div class="nav"></div>

关于html - 我的导航在 Internet Explorer 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41416439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com