我剛開始構建一個簡單的導航欄,並意識到頁面頂部有某種默認的填充/頁邊距。我嘗試使用margin:0 & padding:0,但它只修復了水平問題。我在OS X El Capitan上使用chrome。製作一個導航欄填充頂部空間(非body邊距:0;)
body{
\t margin:0;
\t padding:0;
}
#navigation{
\t width:100%;
\t height:auto;
\t background-color:orange;
}
li{
list-style-type:none;
\t display:inline-block;
}
<nav id="navigation">
<ul>
<li><a href="#">Home</a></li>
<li><a href="">php stuff</a></li>
<li><a href="">about me</a></li>
<li><a href="">Contact</a></li>
</ul>
</nav>
右鍵單擊 - 檢查 - 檢查'ul'元素。 – Vucko
我不期待那是愚蠢的。我不習慣使用檢查功能,我應該經常這樣做。謝謝哥們! – axul