我正在尝试在这里做一些非常简单的事情。我只想让我的文本出现在它所在的表格单元格的底部。但我想在 CSS 中完成,而不是在 html 标记本身中。
为什么下面显示的代码不起作用?在下面的示例中,我的文本出现在单元格的中间,而不是底部。为什么?
<style type="text/css">
.myClass2 {
color:red;
font-weight:bold;
font-style:italic;
vertical-align:text-bottom;
text-align: center;
}
</style>
<table bgcolor="black" border="1">
<tr>
<td bgcolor="white" class="myClass1" width="300">
<div class="myClass2">
Why won't this align at the bottom?
</div>
</td>
<td height="100" bgcolor="white">
Something very tall here.
</td>
</tr>
</table>