所以我一直在創建一個非常基本的網站,其中header
,nav
,主容器和footer
。我在我的網站上使用了viewport
標籤。如何去除div標籤周圍的白色邊距?
我將div
的width
設置爲100%
時,出現了我的問題。
這裏是我的代碼:
#header {
background-color: black;
color: white;
text-align: center;
padding: 5px;
}
#nav {
line-height: 60px;
background-color: #FFFFFF;
min-height: 60px;
width: 100%;
left: 0px;
text-decoration: none;
}
#nav a {
font-family: sans-serif;
font-size: 25px;
text-decoration: none;
float: left;
margin-left: 10px;
}
#section {
min-width: 50%;
min-height: 479px;
float: left;
}
#section p {
font-family: sans-serif;
font-size: 20px;
}
#footer {
background-color: black;
color: white;
clear: both;
text-align: right;
line-height: 40px;
height: 40px;
}
#footer p {
margin-right: 30px;
}
有什麼我需要改變,以擺脫周圍的DIV的白邊的,我已經試過的事情,才能擺脫它,但他們都不工作, 任何幫助將不勝感激。
您可以將您的HTML代碼,請?通過「白色邊緣」來理解你的意思會更容易。 –