我试图设计一个网站,我想要一个元素内100%高度的div,然后是其中的一些其他div,以特定方式格式化。在TD内部创建高度为100%的div
我想要的代码是这样的
CSS
#main1{
margin: 0 auto;
width:300px;
background: red;
position:absolute;
}
#content1{
top:0;
width: 300px;
height: 250px;
background: gray;
}
#content2{
width: 300px;
height: 250px;
background: yellow;
}
#content3{
width: 300px;
height: 250px;
background: brown;
}
#bottom{
width: 300px;
height: 75px;
position:absolute;
bottom:0;
background: blue;
}
,我设计了像这样
<td width="300" valign="top" style="position:relative; height:100%">
<div id="main1">
<div id="content1">/*****Content1****/</div>
<div id="content2">/*****Content2****/</div>
<div id="content3">/*****Content3****/</div>
<div id="bottom">/*****Content4****/</div>
</div>
</td>
我想ID内容1股利的最顶端,并与ID底部在td内的极端底部,所以如果元素的高度发生变化,它会自动在顶部和底部对齐,并在内部div之间留有边距,同样我也希望它全部是br欠款兼容。 我试过了,它在IE中工作。
我已经尝试了这么多的代码,但无法得到解决
您可以在这个环节在右侧看到哪里,什么我试图让
http://www.spoiledagent.com/about_hanu.html
感谢
http:// matthewjamestaylor。com/blog/keep-footers-at-the-the-the-the-the-page看看这个;) – DiederikEEn 2013-05-01 09:09:30