我有一个页面的顶部和底部已知内容的网页,以及未知的中间部分。中间部分可以短至100px或高于1000px。使div在每个浏览器的页面底部出现
制作中间部分min-height: 100%;
不是选项。
我找到了一个很好的回答我的问题:
html{
height:100%;
width:100%;
}
body{
min-height:100%;
display:table;
}
.top{
display:block;
}
.main{
display:block;
}
.buttom{
display:table-footer-group;
}
<html>
<body>
<div class="top">
\t Fixed top box
</div>
<div class="main">
\t Box with unknown content
</div>
<div class="buttom">
\t Fixed buttom box
</div>
</body>
</html>
但由于某些原因,它不mozila浏览器。任何人都可以提出一些适用于每个浏览器
澄清:所有DIV应该是独立的,并在任何情况下一个DIV出现在顶部的另一个
工作!谢谢! – levkaster