我的目标:有一个主页,它有一个固定的,静态页脚。最简单的解释方法就是看这个网站,http://www.foxtie.com/。我试图做一些像狐狸一样的事情,坚持使用页脚,但是我希望整个页脚不会从实际屏幕的底部移动。在CSS中有静态图像的静态页脚?
我的代码:我已经改变了,没有改变,并且重新改变了它。所以我可能比一个小时前更远了20步。这是我的。 (忍受着我,先在这里发帖,而且我对html/css非常生疏)。
任何帮助表示赞赏。
的HTML:
<html>
<body>
<div id="container">
<div id="nav"></div>
<div id="content"></div>
<div id="footer">
<div id="imginthefooter"></div>
</div>
</div>
</body>
</html>
的CSS:
body {
height: 100%;
margin: 0px;
}
html {
background-color: #999;
margin: 0px;
height: 100%;
}
#container {
min-height: 100%;
background-color: #666;
position: relative;
}
#content {
overflow: auto;
background-color:#333;
}
#footer {
background-color:#000;
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
height:100px;
overflow: hidden;
}
#imginthefooter {
background: url(Images/Elk.png);
width:100px;
height:300px;
z-index:300;
bottom: 0px;
top: -108px;
right: -150px;
position: relative;
}
你需要这个http://ryanfait.com/sticky-footer/ –