【发布时间】:2015-05-24 21:24:02
【问题描述】:
在这段代码中,我有一个置顶页脚和上面的内容部分,但为什么 height:100% 不适用于内容部分?
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 60px;
height: 100%;
}
.content {
background-color: #116655;
height: 100%;
}
.footer {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 60px;
background-color: #ffcc44;
}
<div class="content">
<div>content</div>
</div>
<footer class="footer">
My footer
</footer>
【问题讨论】: