我一直在試圖使我的網站有一個甚至利潤率的包裝,但底部邊距總是太大。爲了隔離這個問題,我註釋掉了html中的所有div內容,並註釋掉了與基本div無關的所有css選擇器,而窗口div仍然會通過頁腳。窗口div超出頁腳
這是css,你會注意到一些css屬性以s開頭拼寫錯誤。不要擔心這些,這只是我註釋掉css屬性的快捷方式。
.window {
width: 88%;
height: 99%;
smargin-top: 3%;
smin-height: 800px;
margin-left: 7%;
sbox-shadow: 0px 0px 10px 1px #000000;
min-width: 1110px;
background-color: #FF0000;
}
.header {
height: 15%;
width: 100%;
background-color: #DDDDDD;
padding-top: 1%;
smin-height: 100px;
}
.nav {
font-size: 20px;
spadding-top: 1%;
height: 5%;
width: 100%;
background-color: #999999;
font-family: Tahoma, Geneva, sans-serif;
smin-height: 35px;
max-height: 40px;
}
.content {
height: 60%;
width: 100%;
smin-height: 350px;
: ;
spadding-top: 3%;
background-color: #FFFFFF;
}
.footer {
font-family: Arial, Helvetica, sans-serif;
height: 5%;
width: 100%;
background-color: #DDDDDD;
smin-height: 30px;
}
這裏是html,我排除了所有註釋掉的內容,所以問題將從它的基本基礎結構中分離出來。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Excercise 2 CSS</title>
</head>
<body>
<div class="window">
<div class="header">
</div>
<div class="nav">
</div>
<div class="content">
</div>
<div class="footer">
</div>
</div>
</body>
</html>
你面對問題在一些特定的瀏覽器..? –
你的意思是「底部邊距總是太大」?您是否指腳註下方的保證金?或之前的頁腳和容器之間的邊距? –