首页 新闻 会员 周边

绝对定位后,ie和ff的不同,到现在没人能解答

0
悬赏园豆:10 [已解决问题] 解决于 2010-08-13 10:32

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">

.fl{position:absolute;width:200px;height:200px;margin:30px;background:yellow;}
.ac{position:absolute;width:300px;height:300px;border:1px solid;background:red;z-index:1000;}

</style>
    </head>
    <body>

<div class="fl"><div class="ac">为什么在ie下黄色把红色盖住了呢?该如何修改使红色盖住黄色</div></div>
<div class="fl"></div>

    </body>

    </html>

 

 

如何修改,能是ie下能像ff下一样

问题补充: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> .out1{position:absolute;width:200px;height:200px;left:10px;margin:30px;background:yellow;} .out2{position:absolute;width:200px;height:200px;left:300px;margin:30px;background:yellow;} .in{position:absolute;width:300px;height:300px;border:1px solid;background:red;z-index:1000;} </style> </head> <body> <div class="out1">out1<div class="in">为什么在ie下out1的红色没有把out2盖住。在ff下就可以。</div></div> <div class="out2">out2</div> </body> </html>
日—月的主页 日—月 | 菜鸟二级 | 园豆:215
提问于:2010-08-12 23:10
< >
分享
最佳答案
0

这是IE的ZIndexStack的BUG,ac的zindex是从他的容器DIV开始算的,只能尽量避免这种DOM结构了

收获园豆:10
Gray Zhang | 专家六级 |园豆:17610 | 2010-08-12 23:58
其他回答(1)
0

IE的BUG吧。

把out2放到前面就可

<div class="out2">out2</div>

<div class="out1">out1<div class="in">为什么在ie下out1的红色没有把out2盖住。在ff下就可以。</div></div>

阿松 | 园豆:601 (小虾三级) | 2010-08-13 10:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册