【发布时间】:2014-07-06 18:18:45
【问题描述】:
您好,我有这个代码,
<html>
<body>
<table>
<tr>
<td>
<div class="the-div">h:100%</div>
</td>
<td>
<div class="the-div-w-height">h:100px</div>
</td>
</tr>
</table>
</body>
</html>
这种风格,
.the-div
{
height: 100%;
background-color: red;
}
.the-div-w-height
{
height : 100px;
background-color: yellow;
}
我想让红色的div在td里面拉伸,其他div可以根据内容改变高度,第一个div要跟table一起拉伸
谢谢
【问题讨论】:
-
@NoobEditor 在 Chrome 中 OK,在 Firefox 中 KO(我猜也需要
td { height: 100% }) -
@gillesc 与表 imho 无关,这是一个不同的情况,尤其是在 Firefox 中
-
我这个this是相关的。
标签: html css html-table stretch