<html><head>
<meta http-equiv=Content-Type content=text/html;charset=gb2312>
<title></title>
</head>
<table width="100" border="0" align="center">
<tr>
<td>aaaaaaa</td>
</tr>
<tr>
<td> <div id="Layer1" style="position:absolute; width:236px; height:166px; z-index:1; background-color: #6666FF; layer-background-color: #6666FF; border: 1px none #000000;"></div></td>
</tr>
</table>
</body></html>
只要将<div></div>的代码放入<table></table>中,然后去掉style="position:absolute; 中的position:absolute; 即可让<div>给我老老实实的呆着拉,最好后面加上overflow: scroll;防止溢出,要不会很难看的哦
<div id="ta" style="position: relative; width:87px; height:300px; z-index:2; left: 30%; top: 35%;">
这就是一个相对定位,绝对定位只需将position改为:absolute
博客介绍了div元素的定位方式,通过示例展示了相对定位,将position属性设为relative,同时提到绝对定位只需将position改为absolute。
337

被折叠的 条评论
为什么被折叠?



