html - 页脚不会调整到页面大小

标签 html css footer

我希望我的页脚能够调整页面大小或我移动设备上的屏幕大小,这样它看起来就不会像一个非常大的空白页脚。

HTML:

<footer>
    <div class="footerwrapper">
    </div>
</footer>

CSS:

footer {
    height:100%;
    border-top: 1px dashed #FDF3E7;
    background-color:#250800;
    text-align:left;
}

.footerwrapper { border-bottom: 1px dotted #3B3738;padding:50px;min-height:200px; background-color:#220a03; margin: 0 auto; }

如上所示,我试图将包装器与我的父页脚重叠,但它并没有真正按照我想要的方式工作。我实际上只希望页脚填充页面的其余部分(也在移动设备上),而不会淹没页脚。有人吗?

最佳答案

CSS文件:

footer{
    min-height:200px; //you can define any height you like!
}
footer .footerwrapper {
    border-bottom: 1px dotted #3B3738;
    background-color:#220a03; 
    margin: 0 auto;
    width: 500px;// this width you can define your self
    position: fixed;
    bottom: 0;
}

关于html - 页脚不会调整到页面大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21009966/

相关文章:

html - 带 3 列的页脚,左右固定,中心流体最大化

html - 删除页面底部的空白

html - thead/tbody 跨越打印的 HTML 的多页但不在第一页

html - 无法正确排列 div

jquery - iOs 的 CSS3 和 jQuery 动画缓慢

html - 固定位置页脚中的流体宽度 block 元素链接

css - HTML/CSS : Layout Issues

javascript - 如何在 jQuery 中为平行四边形制作动画

html - 边框不包括在媒体查询的宽度计算中

html - 垂直居中图像没有 float :none