61,112
社区成员
发帖
与我相关
我的任务
分享
<!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" dir="ltr" lang="zh-CN">
<head profile="http://gmpg.org/xfn/11">
</head>
<body style="font-size:12px">
<div style="height:468px;overflow-y:auto;position:relative;">
<div style="position:relative;">
<div style="background-color:#808080;height:140px;width:130px;position:relative;">
方块一,显示出来了
</div>
<table width="580">
<tr>
<td width=130px>
<div style="background-color:grey;height:140px;width:130px;position:auto;">
方块二,应该能显示
只有position:不设置或auto能显示
</div>
<div style="background-color:green;height:140px;width:130px;position:relative;">
方块三,应该是被隐藏了
position:relative的容器是我需要的
如果被隐藏,用IE8附带的开发人员工具随便把背景色之类的CSS禁止再启用就看见了
</div>
<div style="background-color:blue;height:140px;width:130px;position:absolute;">
方块四,应该是被隐藏了
</div>
</td>
<td width="430px" style="background-color:#AA00FF;">
<div style="background-color:#000;height:140px;position:relative;">
长条的
</div>
</td>
</tr>
<tr height="300px">
<td/>
<td>
把滚动条拉出来(要overflow=auto才有会问题)
</td>
</tr>
</table>
</div>
</div>
</body>
</html>