我正在嘗試將頁腳粘貼到頁面底部。我希望它具有40px以上和以下的保證金,但它的工作不正常,並繼續在我的網站上的內容。有人可以幫我嗎?我如何獲得粘性頁腳40px margin-below和above
<div id="footer">
<div id="footer-line"> </div>
<div id="footer-nav"> <a href="index.html">Home</a> | <a href="expertise.html">Expertise</a> | <a href="doctors.html">Doctors</a> | <a href="facility.html">Facility</a> | <a href="contacts.html">Contacts</a></div>
<div id="footer-copyright">© 2013 Website, Inc. All Rights Reserved.</div>
</div>
#footer {
margin: auto;
width: 900px;
height: 50px;
margin-bottom: 40px;
position: fixed;
bottom: 0;
}
#footer-line {
margin: auto;
width: 900px;
height: 2px;
background-color: #C9DA2A;
margin-top: 35px;
}
#footer-nav {
margin: auto;
float: left;
width: auto;
height: 30px;
color: #666666;
font-size: 16px;
font-family: "Times New Roman", Times, serif;
margin-top: 15px;
text-decoration: none;
}
#footer-nav a {
color: #666666;
font-size: 16px;
font-family: "Times New Roman", Times, serif;
text-decoration: none;
}
#footer-copyright {
margin: auto;
float: right;
width: auto;
height: 33px;
color: #666666;
font-size: 16px;
font-family: "Times New Roman", Times, serif;
margin-top: 17px;
text-decoration: none;
}
但是,如果我讓窗口更小的高度明智它會超過我的內容? – mystycs
這是因爲它的固定。你不想看到任何落後的內容嗎?這可能嗎? http://jsfiddle.net/HZ5NW/1/ – shammelburg