<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
<table border=1><tr><td>iasdfasdfa<br>asdfasdfasdf<br>asdfasdfasdf<br>asdfasdf</td><td valign=top style='vertical-align: top;'><h1>This Text Won't Valign Top</h1></td></tr></table>
答案 0 :(得分:0)
它确实与顶部对齐。只是<h1>
元素有一个默认的边距推动它。删除它:
h1 {
margin: 0
}
<table border=1>
<tr>
<td>iasdfasdfa
<br>asdfasdfasdf
<br>asdfasdfasdf
<br>asdfasdf</td>
<td style='vertical-align: top;'>
<h1>This Text Won't Valign Top</h1></td>
</tr>
</table>
注意:请勿使用valign=top
,因为它已被弃用了很长时间。