我有以下代码:
<td style="position: relative; min-height: 60px; vertical-align: top;">
Contents of table cell, variable height, could be more than 60px;
<div style="position: absolute; bottom: 0px;">
Notice
</div>
</td>
这根本不起作用。由于某种原因,`position: relative` 命令没有被 TD 读取,并且提示 DIV 被放置在内容容器外部,位于页面底部。我尝试将 TD 的所有内容都放到一个 DIV 中,例如:
<td>
<div style="position: relative; min-height: 60px; vertical-align: top;">
Contents of table cell, variable height, could be more than 60px;
<div style="position: absolute; bottom: 0px;">
Notice
</div>
</div>
</td>
然而,这样会产生一个新问题。由于表格单元格内容的高度是可变的,提示DIV并不总是在单元格底部。如果一个单元格超过了60px标记,但其他单元格没有超过,那么在其他单元格中,提示DIV将在60px下面,而不是在底部。