我正在做一些作業。我無法將頁腳正確地放在頁面的底部,無論我填入每個頁面多少......任何人都可以給我一個指針?包裝div的寬度和高度必須設置爲預設。我希望頁腳坐在頁面的底部。應填寫正文內容,頁腳應位於頁面底部。頂部應該是50px到身體的底部。HTML/CSS放置問題
body
{
background-color: #ffffff;
}
.wrapper
{
width: 960px;
height: 700px;
background-color: #D3D1C2;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
}
.masthead
{
height: 150px;
width: 960px;
background-color: #000;
}
#nav-wrapper
{
width: 960px;
margin: 0 auto;
padding: 20px 0;
background: #3D3331;
}
ul#nav
{
font-family: Verdana;
font-size: 14px;
list-style: none;
margin: 0 auto;
padding: 0;
width: 960px;
overflow: auto;
}
ul#nav li
{
display: inline;
}
ul#nav li a
{
text-decoration: none;
display: block;
padding: 5px 21px;
background: #5F3222;
color: #eee;
float: left;
text-align: center;
border-top: 2px solid #815444;
border-right: 2px solid #3d1000;
border-bottom: 2px solid #3d1000;
border-left: 2px solid #815444;
}
ul#nav li a:hover
{
background: #a37666;
color: #000;
border-top: 2px solid #815444;
border-right: 2px solid #c59888;
border-bottom: 2px solid #c59888;
border-left: 2px solid #815444;
}
.body
{
}
.footer
{
clear: both;
width: 960px;
height: 50px;
background: #000;
margin-bottom: 10px;
}
h1
{
text-align: center;
}
HTML:
<html>
<head>
<!--I am using TextWrangler to do my html css editing on my Mac-->
<link rel="stylesheet" type="text/css" href="style.css" />
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<title>
KG Doors
</title>
</head>
<body>
<div class="wrapper">
<div class="masthead">
</div><!--end the masthead div -->
<div id="nav-wrapper">
<ul id="nav">
<li><a href="index.html">Home</a></li>
<li><a href="about.html">Services</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<div class="body">
<br/>KG Doors offers replacement of:
<br/>- Springs
<br/>- Cables
<br/>- Openers
<br/>- Keypads
<br/>- Transmitters
<br/>- Garage Doors
<br/>- Sections
</div><!--end the body div -->
<div class="footer">
</div><!--end the footer div -->
</div><!--end the wrapper div -->
</body>
</html>
你能澄清你的意思嗎? html會有幫助 – mcallinder 2012-01-14 04:49:20
對不起,我正在編輯HTML ...沒有正確地獲取所有格式。 – YoungGuy 2012-01-14 04:51:32
看看這個:[http://ryanfait.com/sticky-footer/](http://ryanfait.com/sticky-footer/) – Avinash 2012-01-16 04:15:19