遇到一个奇怪问题,调试了好长时间,IE很闹心:
条件是:不添加dtd标准,使用了table的height:100%;属性,模拟代码如下:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<table style="height:100%" >
<tr>
<td><div style=" overflow:auto; height:100%; width:100%">
<div>
saddddaaaaaaaaaaadddddddd
</div><br/><div style="position:relative"><img src="http://www.baidu.com/img/baidu_logo.gif" />sssssssssssssssss</div>
</div></td>
</tr>
</table>
</body>
</html>
在IE下<div style="position:relative"><img src="http://www.baidu.com/img/baidu_logo.gif" />sssssssssssssssss</div>
内容消失,它下面的元素也消失,只要去除上面html中的属性如:height:100%;style=" overflow:auto; height:100%; width:100% ;或者此元素前面的<div>
saddddaaaaaaaaaaadddddddd
</div><br/>也恢复正常,如果元素样式position:relative为其他的此正常