我不太确定如何解释这个问题,但本质上,我的固定导航栏要么不滚动,但超链接起作用,要么导航栏滚动,但超链接不起作用。当我尝试在 html 和 css 中修复它时,这个循环不断发生。我真的很感激对此的一些帮助。
这是导航栏的 html:
我发誓它在原子中看起来并不那么混乱
这是导航栏的 CSS:
我知道我有太多“列表样式类型”,我仍然需要删除多余的。
ul {
list-style-type: none;
}
{
position: fixed;
}
.navbar {
position: fixed;
top: 0;
width: 100%;
list-style-type: none;
}
.navbar {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
border: 1px solid #e7e7e7;
background-color: #f3f3f3;
}
li {
float: left;
}
li a {
display: block;
color: #666;
text-align: center;
padding: 14px 16px;
text-decoration: none;
list-style-type: none;
}
li a:hover:not(.active) {
background-color: #ddd;
}
li a.active {
color: white;
background-color: #04AA6D;
}
我对 html&css 还很陌生,所以请随意因为愚蠢的事情而羞辱我,但老实说我很难过。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号