层定位

<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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值