ZeroOpacityLayers.html 1.68 KB
Newer Older
thatcher's avatar
thatcher committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<html>
<head>
<style>
DIV.one {
            position:absolute;
            top:10px;
            left:10px;
            background-color:rgb(0,0,255);
            width:200px;
            height:200px;
            }
            
DIV.two {
            position:absolute;
            top:10px;
            left:10px;
            background-color:rgb(0,255,0);
            width:180px;
            height:180px;
}

DIV.three-a {
            position:absolute;
            top:10px;
            left:10px;
            background-color:rgb(255,0,0);
            width:160px;
            height:160px;
            opacity:0;
}
DIV.three-b {
            position:absolute;
            top:80px;
            left:80px;
            background-color:rgb(255,255,0);
            width:200px;
            height:200px;
            opacity:0.5;
}
DIV.four {
            position:absolute;
            top:10px;
            left:10px;
            background-color:rgb(255,255,255);
            width:140px;
            height:140px;
            opacity:1;
}
P.desc { 
			position: absolute; 
			top:300px;
			left:10px;
			}
</style>
</head>
<body>
<div class="one">
<div class="two">
<div class="three-a">
Should not see this text.
<div class="four">
Should not see this text.
</div>
</div>
<div class="three-b">
</div>
</div>
</div>
<p class="desc">
Below are four boxes all within each other, and a box overlaping other boxes. The 3rd inner box is red, and has an opacity of zero, and the box within it is black and has an opacity of 1. As the third box has opacity zero, the inner black is not visible. The yellow block has opacity of 0.5, and is as the same level in the DOM tree as the 3rd inner box.
</div>
</body>
</html>