我正在重做我的网站 - 当我有时间时它正在构建 - 我在四个页面中的两个页面上遇到了一些关于页脚的问题 - 我是不太确定为什么它不起作用,因为它似乎在其中两个页面上工作正常。我正在使用这里的技术:(ryanfait.com/resources/footer-stick-to-bottom-of-page/)
我在我的 CSS 中使用这些值:
/* BOTTOM BAR */
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -122px;
}
.push, .footer {
clear: both;
width: 100%;
height: 122px;
}
.footer {
text-align: right;
padding-right: 0px;
padding-left: 0px;
clear:both;
background-color: #2e2e2e;
-moz-box-shadow: 0px -1px 0px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.6);
-webkit-box-shadow: 0px -1px 0px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.6);
box-shadow: 0px -1px 0px rgba(0,0,0,0.1), inset 0px 1px 0px rgba(255,255,255,0.6);
border-top:1px solid #36383D;
}
.bottom_content {
width: 900px;
margin-left:auto;
margin-right:auto;
padding-top: 25px;
border: 0px;
}
.copywrite {
float: left;
text-align: left;
padding:0px;
margin-top: 0px;
clear: both;
font-family: Helvetica, Arial;
font-size:24px;
font-weight:300;
color: #3c3e43;
}
- 它在这里工作正常:http://bit.ly/MlV6JP
但不在此处:http://bit.ly/NfVoRR 或者关于页面 (/test/test_about.php)
我尝试了很多不同的方法,但都无济于事!开始用它撕掉我的头发,所以任何建议都会非常感激
编辑 - 这是我所看到的:jameshenry.info/test/BottomExamples.png我在 chrome、safari 和 safari iOS 中看到了这一点。我希望它始终位于页面底部,页面内容下方。
最佳答案
问题出在您的 HTML 中。
这是源代码中标签嵌套不当的示例:
<a class="fancybox-thumb" rel="gallery" href="../images/photography/fullsize/MVI_4003-2.jpg" width="249" height="148"><img src="../images/photography/thumbnail/MVI_4003-2-thumb.jpg"></div></a>
如您所见,您的 anchor 中有一个不应该存在的结束 div 标记。修复这些类型的错误,您的页脚应该会按预期工作。
关于css - 为什么我的页脚不粘?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11471901/