我制作了放置在网页底部的页脚部分。当我的网页内容小于浏览器视口的高度时,我遇到了一个问题,这会在页脚和页面末尾之间留下空白。我试图用这块CSS来解决它。位于页面或屏幕底部的位置div
.footer {
position: absolute;
bottom: 0;
height: 125px;
}
它在我的网页上完美运行,内容很少,但对于大网页,页脚重叠了内容。我遵循了几个在线教程,但我仍然无法做到正确。
<body class="bg-1">
<div class="container-full">
<div class="container">
...
</div>
</div>
<div class="footer text-center">
...
</div>
</body>
.container-full {
width: 100%;
height: 100%;
padding-top: 70px;
margin: 0 auto 125px;
}
.bg-1 {
background: url(../img/1.png) no-repeat center center fixed;
background-size: cover;
height: 100%;
}
.footer {
position: absolute;
bottom: 0;
height: 125px;
}
我正在使用Twitter Bootstrap。
改变位置:固定 –
添加的margin-top:125px;保证金你的div的高度 –
@NagaSaiA我不想让它变得粘稠。 – Jeremy