在 IE7(或更高版本的 IE7 模式下的 Internet Explorer)上查看以下代码:
<!DOCTYPE html>
<html>
<head>
<style>
ol, li
{
margin: 0;
padding: 0;
list-style: none;
}
li
{
background: yellow;
}
li table
{
background: red;
margin: 0;
padding: 0;
border: none;
}
</style>
</head>
<body>
<ol>
<li>
<table cellpadding="0" cellspacing="0" border="0"><tr><td>test</td></tr></table>
</li>
<li>
<table cellpadding="0" cellspacing="0" border="0"><tr><td>test</td></tr></table>
</li>
</ol>
</body>
</html>
在每个 LI 的底部添加一个空格。知道为什么吗?你怎么能去掉那个多余的空间?
注意:我尝试使用 DIVdisplay:list-item
而不是 LI,我也可以通过这种方式重现问题。