【发布时间】:2017-07-07 15:57:27
【问题描述】:
我这里有这个代码:http://jsfiddle.net/52yekaL9/
html, body {
height: 100%;
}
.content {
height: 100%;
}
.part {
height: 100%;
width: 100%;
}
.a { background-color: red; }
.b { background-color: green; }
.c { background-color: blue; }
.d { background-color: orange; }
<div class="content">
<div class="part a">1</div>
<div class="part b" style="height:150px;">2</div>
<div class="part c">3</div>
</div>
<div class="footer d">
this footer
</div>
问题出在我的div.footer d。我看到它是这种形式:div.part b。我正在测试,我看看我是否改变了.content 的高度,页脚也会移动。
但我不认为正确的改变方法是:200% + 150px
还有其他方法可以将页脚 div 放在内容 div 之后吗?
【问题讨论】: