我有一些 HTML 可以在 FireFox3/Opera/Safari 上正常显示,但不能在 IE7 上显示。片段如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head></head>
<body bgcolor="#AA5566" >
<table width="100%">
<tr>
<td height="37" valign="top"><img style="float:right;" border="0" src="foo.png" width="37" height="37"/></td>
<td width="600" rowspan="2" >
<table width="600" height="800"><tr><td><img src="bar.jpg" width="600" height="800"/></td></tr></table>
</td>
<td height="37" valign="top"><img style="float:left;" border="0" src="foo.png" width="37" height="37"/></td>
</tr>
<!-- This row doesnt fill the vertical space on IE7 //-->
<tr>
<td valign="top" bgcolor="#112233"> </td>
<td valign="top" bgcolor="#112233"> </td>
</tr>
</table>
</body>
第二行不会正确填充由第一行中间列创建的垂直空间(注意 rowspan="2")。相反,即使我将它们的高度设置为 37,第一行和第三列也会向下扩展。下图显示了 IE7 和 Firefox3 中发生的情况......
编辑:将 HTML 文档类型添加到代码片段中。添加了截图。
任何帮助表示赞赏,谢谢:)