我剛剛開始構建這個網站時出現了這個奇怪的問題。我想讓頁眉與頁面頂部完全齊平。但由於某種原因,有一個小的空間,大約20px高,不管我嘗試什麼都不會消失。我假設只有一些關於CSS和html的東西我沒有得到,所以你們可以幫我解決嗎?獲取標題與頁面頂部對齊
CSS:
#header {
background-color:#3429C9;
/*-webkit-border-radius:15px;
-moz-border-radius:15px;
border-radius:15px;*/
display:block;
position:relative;
z-index:2;
margin-top:-20px;
border-bottom:2px solid white;
margin-bottom:20px;
height:60px;
}
body {
text-align:center;
font-family: Georgia, Serif;
background: #000000;
margin:0;
height:100px;
display:block;
border:2px solid red;
}
你可以在這裏發表您的代碼,看看我們能做些什麼www.jsfiddle.net – 2012-07-22 09:50:31
我認爲你需要發佈毫無疑問,這是你的頭和它的CSS的內容推動下來。 – BonyT 2012-07-22 09:50:47
我想我其實已經想通了。出於某種原因,我不太明白,當我給我的標題填充1px時,它對齊。感謝無論如何,傢伙! – barndog 2012-07-22 09:52:35