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;
}
好像有隻與固定的資產淨值問題,有一次我將內容放在那裏(列表中的項目,在這種情況下)
那樣做了,謝謝! –