伙计们,
我正在构建这个响应式网站,底部有 float 的页脚。
在我的 index.page ( http://testi3.aada.fi/ ) 上,我的代码工作正常,但我的内容页面 () 有问题,即使我对 float 页脚使用相同的代码..
有人可以提示我如何解决这个问题吗?
我的 float 代码:
.container {
min-height: 100%;
/* equal to footer height */
margin-bottom: -120px;
}
.container:after {
content: "";
display: block;
}
.site-footer, .container:after {
/* .push must be the same height as footer */
height: 120px;
text-align: center;
}
.site-footer {
background-image: url(../images/footer_bg_trans.png);
background-repeat: no-repeat;
background-position: center top;
text-align: center;
position: fixed;
width: 100%;
bottom: 0;
}
/米卡
最佳答案
内容页面上的 CSS 与索引页面上的 CSS 不同。索引页上 .site-footer 的 CSS 是:
.site-footer {
background-image: url("../images/footer_bg_trans.png");
background-position: center top;
background-repeat: no-repeat;
bottom: 0;
position: fixed;
text-align: center;
width: 100%;
}
在内容页面上它的位置:
.site-footer {
background-image: url("../images/content_footer_bg.png");
background-position: center top;
background-repeat: no-repeat;
margin-top: 10px;
text-align: center;
}
你缺少 width: 100%;位置:固定;底部:0;
关于css - float 页脚问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19385594/