Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Z-索引,块相互叠加,这些块中的引用最重要 a{位置:绝对;顶部:20px;颜色:#0F0;z索引:5;} div{位置:绝对;顶部:0;左侧:0;宽度:100%;高度:50px;背景:#066;} .a{z-索引:4;} .b{z-index:3;} .c{z-索引:2;} .d{z-索引:1;} .a{左:10px;} .BA{左:50px;} .ca{左:100px;} .da{左:150px;}_Html_Css_Internet Explorer 7_Z Index - Fatal编程技术网

Html Z-索引,块相互叠加,这些块中的引用最重要 a{位置:绝对;顶部:20px;颜色:#0F0;z索引:5;} div{位置:绝对;顶部:0;左侧:0;宽度:100%;高度:50px;背景:#066;} .a{z-索引:4;} .b{z-index:3;} .c{z-索引:2;} .d{z-索引:1;} .a{左:10px;} .BA{左:50px;} .ca{左:100px;} .da{左:150px;}

Html Z-索引,块相互叠加,这些块中的引用最重要 a{位置:绝对;顶部:20px;颜色:#0F0;z索引:5;} div{位置:绝对;顶部:0;左侧:0;宽度:100%;高度:50px;背景:#066;} .a{z-索引:4;} .b{z-index:3;} .c{z-索引:2;} .d{z-索引:1;} .a{左:10px;} .BA{左:50px;} .ca{左:100px;} .da{左:150px;},html,css,internet-explorer-7,z-index,Html,Css,Internet Explorer 7,Z Index,愿望只有一件事,那就是所有的链接都在块上。在ie7中,它起了作用 帮助解决问题。internet explorer使许多事情出错。其他浏览器,如safari、firefox和chrome,都能正确地实现这一点 位置:绝对位置表示,顶部和左侧是绝对测量的,也就是说,根据文档的边框。您强制所有元素在同一位置打印 基本上。这并不奇怪 更清楚地说: 当您将css定位添加到元素并为其提供z索引(而不是自动)时,它将创建新的堆叠上下文,并在新上下文中创建新的堆叠级别 见: 因此,定位和z索引的堆叠div都

愿望只有一件事,那就是所有的链接都在块上。在ie7中,它起了作用


帮助解决问题。

internet explorer使许多事情出错。其他浏览器,如safari、firefox和chrome,都能正确地实现这一点

位置:绝对位置
表示,
顶部
左侧
是绝对测量的,也就是说,根据文档的边框。您强制所有元素在同一位置打印

基本上。这并不奇怪

更清楚地说:

当您将css定位添加到元素并为其提供z索引(而不是自动)时,它将创建新的堆叠上下文,并在新上下文中创建新的堆叠级别

见:

因此,定位和z索引的堆叠div都有自己的堆叠上下文,因此只有顶部的div才会显示。

a{position:absolute;top:20px;color:#0F0;}div{float:left;margin right:-100%;width:100%;height:50px;background:#066;}.a{left:10px;}.b{left:50px;}.c{left:100px;}.d a{left:150px;}

<style>
a { position:absolute; top:20px; color:#0F0; z-index:5; }
div { position:absolute; top:0; left:0; width:100%; height:50px; background:#066; }
.a { z-index:4; }
.b { z-index:3; }
.c { z-index:2; }
.d { z-index:1; }
.a a { left:10px; }
.b a { left:50px; }
.c a { left:100px; }
.d a { left:150px; }
</style>

<div class="a"><a href="#" title="">123</a></div>
<div class="b"><a href="#" title="">123</a></div>
<div class="c"><a href="#" title="">123</a></div>
<div class="d"><a href="#" title="">123</a></div>