无论内容中有多少文本,我都试图将页脚保持在底部。 我究竟做错了什么?布局是:
.top{
width:500px;
height:100px;
background-color:black;
}
.content{
width:500px;
min-height:100%;
position:relative;
}
.footer{
width:500px;
height:100px;
background-color:blue;
position:absolute;
bottom:0;
}
<div class="top"></div>
<div class="content"></div>
<div class="footer"></div>
问候,西蒙
最佳答案
我认为你必须像这样使用 position:fixed:
.footer{
width:500px;
height:100px;
background-color:blue;
position:fixed
bottom:0;
}
关于html - 页脚在底部 文本在中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14983651/