我使用的是来自 woothemes 的免费 wordpress 主题,Swatch 主题。我不知道是否有人也使用这个主题。我遇到了一些问题。当帖子很短时。主题的页脚无法到达底部。留了一 block 空白。太丑了所以我想找到一种方法来修复它。我已经阅读了一些 css 书籍并在谷歌上搜索了很多次,但我仍然找不到办法。所以,希望大家能给我一些建议。我的编程知识太差了。对不起。希望得到您的回复。
最好的问候。
/* 2.1 Containers & Columns */
#wrapper { background: transparent url(images/wrapper-bg-colourstrip.png) repeat-x left top; padding-top: 5px; } /* Top padding is the height of the colour strip image. */
#main{width:575px;}
#main.fullwidth, .layout-full #main, .col-full {width: 900px; margin:0 auto;}
#sidebar{width:250px;}
#sidebar .secondary { width:140px; }
.entry img { max-width:565px; }
.layout-full .entry img { max-width:890px; }
.col-left { float: left; }
.col-right { float: right; }
.two-col-right #main { float:right; }
.two-col-right #sidebar { float:left; }
/* 2.6 Footer */
#footer{padding: 30px 0 20px; background: url(images/bg-ripple-footer.png) repeat top left; color:#999;}
#footer p {}
#footer a { color: #ffffff; }
#footer #credit img{vertical-align:middle;}
#footer #credit span{display:none;}
#footer-widgets { margin-bottom: -5px; background: url(images/bg-ripple-footer-widgets.png) repeat top left; padding:10px 0; }
#footer-widgets .block { padding:20px 10px 0 10px; float:left; }
#footer-widgets .col-1 .block { width:100%; padding-left:0; }
#footer-widgets .col-2 .block { width:420px; padding-left: 20px; }
#footer-widgets .col-3 .block { width:270px; padding-left: 16px; }
#footer-widgets .col-4 .block { width:200px; padding-left: 10px; }
最佳答案
此演示展示了一种广泛使用的实现粘性页脚的方法 http://ryanfait.com/sticky-footer .
HTML 设置:
<div class="wrapper">
<!-- Body Content -->
<div class="push"></div>
</div>
<div class="footer">
<!-- Footer Content -->
</div>
这是执行此操作的 CSS:
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
height: 142px; /* .push must be the same height as .footer */
}
如果失败,您可以尝试向 WooThemes 寻求支持。
关于css - swatch theme 的页脚无法固定在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15953133/