blob: b15b423f219a89b02f30bceda59c434ff217e236 (
plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
<!DOCTYPE>
<html>
<head>
<title>Test position of foreground layer when clipping</title>
<style type="text/css" media="screen">
.box {
position: relative;
display: inline-block;
margin: 60px;
width: 200px;
height: 200px;
border:10px solid black;
color: blue;
padding: 20px;
-webkit-box-sizing: border-box;
-webkit-box-shadow: black 0 0 10px;
background-color:rgba(255, 255, 255, 0.8);
font-size: 220%;
font-weight: bold;
transform: translateZ(0);
}
.child {
position: absolute;
border:2px solid black;
width: 150px;
height: 150px;
padding: 20px;
color: gray;
-webkit-box-sizing: border-box;
transform: translateZ(0);
}
.child > .child {
height: 100px;
width: 100px;
top: 80px;
background-color: green;
font-size: 50%;
}
.negative {
z-index: -1;
left: -50px;
top: -50px;
background-color: rgba(200, 100, 100, 1);
}
.positive {
z-index: 1;
right: -50px;
bottom: -50px;
background-color: rgba(200, 200, 128, 1);
}
</style>
</head>
<body>
<p>The layering of the boxes should not be affected by overflow:hidden.</p>
<div class="box">
Box contents
<div class="negative child">
Behind
<div class="child">
Behind behind
</div>
</div>
<div class="positive child">
In Front
</div>
</div>
<div class="box" style="overflow: hidden;">
Box contents
<div class="negative child">
Behind
<div class="child">
Behind behind
</div>
</div>
<div class="positive child">
In Front
</div>
</div>
</body>
</html>
|