-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
t32-opacity-zorder-c.xht
108 lines (108 loc) · 3.21 KB
/
t32-opacity-zorder-c.xht
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: opacity</title>
<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
<link rel="help" href="http://www.w3.org/TR/css3-color/#transparency" />
<link rel="match" href="t32-opacity-zorder-c-ref.html" />
<meta name="assert" content="Opacity has z-ordering treatment of positioned elements and z-index applies." />
<style type="text/css"><![CDATA[
table { border-spacing: 2px; }
td { border: 1px solid; }
td, div { width: 10px; height: 10px; }
div.up { margin-top: -10px; }
div.pos { position: relative; }
div.opc { opacity: 0.99; }
div.red { background: red; }
div.green { background: green; }
.z0 { z-index: 0; }
.z1 { z-index: 1; }
.zm1 { z-index: -1; }
]]></style>
</head>
<body>
<p>Each of the following boxes should have a green or
very-nearly-green square inside of it:</p>
<table><tr>
<!-- baseline -->
<td>
<div class="red"></div>
<div class="up green"></div>
</td>
<!-- z-index auto or 0 is in positioned elements layer -->
<td>
<div class="pos red"></div>
<div class="up opc green"></div>
<div class="up red"></div>
</td>
<td>
<div class="opc red"></div>
<div class="up pos green"></div>
<div class="up red"></div>
</td>
<td>
<div class="pos red"></div>
<div class="up opc green z0"></div>
<div class="up red"></div>
</td>
<td>
<div class="opc red"></div>
<div class="up pos green z0"></div>
<div class="up red"></div>
</td>
<td>
<div class="pos red z0"></div>
<div class="up opc green"></div>
<div class="up red"></div>
</td>
<td>
<div class="opc red z0"></div>
<div class="up pos green"></div>
<div class="up red"></div>
</td>
<!-- baseline: make sure z-index: auto works -->
<td>
<div class="pos">
<div class="pos green z1"></div>
<div class="up pos red zm1"></div>
</div>
<div class="up pos red z0"></div>
<div class="up pos red"></div>
<div class="up red"></div>
</td>
<!-- baseline: make sure z-index: 0 works -->
<td>
<div class="pos z0">
<div class="pos red z1"></div>
<div class="up pos red zm1"></div>
</div>
<div class="up pos green"></div>
<div class="up red"></div>
</td>
<!-- make sure opacity acts like z-index: 0, not auto -->
<td>
<div class="opc">
<div class="pos red z1"></div>
<div class="up pos red zm1"></div>
</div>
<div class="up pos green"></div>
<div class="up red"></div>
</td>
<!-- make sure z-index does not apply to elements with opacity if they aren't positioned -->
<td>
<div class="opc z1 red"></div>
<div class="up opc red"></div>
<div class="up opc z0 red"></div>
<div class="up opc zm1 green"></div>
</td>
<!-- ... but that it does if they are positioned -->
<td>
<div class="pos opc z1 green"></div>
<div class="up pos opc red"></div>
<div class="up pos opc z0 red"></div>
<div class="up pos opc zm1 red"></div>
</td>
</tr></table>
</body>
</html>