我似乎無法刪除頁面頂部的這一點空間,我嘗試了很多東西並閱讀。似乎工作的唯一的事情是* {margin:0},但我並不真的想這樣做。任何人都有一些洞察問題是在這裏?刪除頁面頂部邊距
您可以在這裏提問查看頁面:http://www.ryanlaurence.com/new/
HTML
<!DOCTYPE html>
<html>
<head>
<link href="Style.css" rel="stylesheet">
</head>
<body>
<div id = "Banner">
<p>Banner</p>
</div>
<div id = "Nav">
<div id="stripe"></div>
<ul>
<li><a href = "#"> Link</a> - </li>
<li><a href = "#"> Link</a> - </li>
<li><a href = "#"> Link</a> - </li>
<li><a href = "#"> Link</a> </li>
</ul>
</div>
<div class="Content">
<div></div>
</div>
<div id="Footer">
</div>
</body>
</html>
CSS
body, html{
background-color: #404040;
margin: 0;
padding: 0;
}
#Banner{
background-color: #333333;
height:200px;
top:0px;
}
#stripe{
height: 10px;
top: -14px;
position:relative;
background-color: #262626
}
#Nav{
width:100%;
height: 60px;
background-color: #262626;
}
#Nav ul{
margin: 0;
color: gray;
position: relative;
text-align: center;
}
#Nav ul li{
display: inline;
}
#Nav ul a{
color: gray;
text-decoration: none;
padding-right: 10px;
padding-left: 10px;
font-size: 25px;
font-family: "Orator Std", verdana;
text-align: center;
}
#Nav ul li a:hover{
color: white;
}
.Content{
background-color: #333333;
/*height: 800px;*/
position: relative;
top: 5px;
}
.Content div{
height:800px;
}
#Footer{
background-color:#57B4CC;
height:150px;
}
如果你想只有頂部邊距爲零。你可以明確提到像margin-top:0px; – kjana83
@ kjana83問題是我根本無法刪除它。 – Artex