【发布时间】:2012-03-20 02:05:19
【问题描述】:
我尝试在我的页面上实现 css 粘性页脚,但它似乎不起作用。页脚位于内容下方,但不粘在页面底部。 http://www.cssstickyfooter.com/
您可以在 www.anderskitson.ca/mrskitson2012 上查看我正在尝试实施的网站
这是我的 html 代码,为简单起见删除了一些代码
<div class="container">
<div id="main" class="row">
<div class=" twelve columns ">
<div class="row">
<div class="11 columns offset-by-one">
<img src="http://anderskitson.ca/mrskitson2012/wp-content/themes/mrskitson2012/images/kidsDrawings.jpg" alt="Kids Drawings"/>
</div>
</div>
</div>
</div>
<!-- container ends-->
</div>
<div id="footer" ></div>
这是我的 CSS 声明
.container{position:relative; min-height:100%; }
#main{ overflow:auto; padding-bottom: 300px; }
#footer{ background-image: url('../images/footer.jpg'); height:300px; width:100%; position: relative; margin-top: -300px; clear:both;}
【问题讨论】:
-
查看我的答案并尝试一下,如果有任何问题或我在某些地方滞后,请告诉我。
标签: html css sticky-footer