0
我在页面顶部的固定导航栏遇到了一些问题。它应该与页面顶部齐平,但不是。这里是我的HTML:如何使固定导航栏与窗口顶部齐平
<nav>
<a href="#">
<div id="logo">
lorem
</div></a>
</nav>
<ul>
*enough li's to go past the bottom of the screen*
</ul>
和我的CSS:
body {
margin: 0px;
padding: 0px;
}
nav {
position: fixed;
display: block;
color: white;
margin: 0 auto;
padding: 0;
width: 100%;
height: 60px;
background-color: #4d4d4d;
}
#logo {
padding-left: 1%;
padding-right: 1%;
color: #75cc83;
width: 180px;
height: 100%;
background-color: #333333;
font-size: 3em;
font-family: candara, sans-serif;
}
好像有只与固定的资产净值问题,有一次我将内容放在那里(列表中的项目,在这种情况下)
那样做了,谢谢! –