css - swatch theme 的页脚无法固定在底部

标签 css wordpress layout themes woothemes

我使用的是来自 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/

相关文章:

php - 如何在 HTML 中将文本框对齐到屏幕中心?

html - 为什么我不能将 top 和 left 设置为 $(window).width() * number

wordpress - Nginx 反向代理将映射/博客映射到 WordPress docker 容器

jquery - 固定布局水平滚动,如 Google Plus

Android:更改 fragment 的背景颜色

javascript - 第二次访问用户后用 cookie 隐藏 div

输入 slider 的 JavaScript If/Else 函数

html - 如何防止在将浏览器缩放更改为 "Ctrl -"或 "Ctrl +"时调整图像大小?

html - 如何在 iframe 中使用 flashvars 参数?

java - 隐藏布局中的所有控件