blob: a0813ae4696ca20e204e62ae90bf9d562fa20091 (
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
|
<!DOCTYPE html>
<title>Overflow:scroll paint order</title>
<link rel="help" href="https://www.w3.org/TR/CSS2/zindex.html">
<link rel="match" href="overflow-scroll-paint-order-ref.html">
<style>
#scroller {
background: red;
padding: 20px;
box-sizing: border-box;
width: 100px;
height: 100px;
overflow: scroll;
}
#negative-margin {
width: 100px;
height: 100px;
background: green;
margin-top: -100px;
}
#foreground1 {
display: inline-block;
width: 50px;
height: 50px;
background: blue;
}
#foreground2 {
display: inline-block;
width: 50px;
height: 50px;
background: magenta;
}
</style>
<!-- The paint order should be:
scroller background (invisible)
scroller child background (invisible)
negative-margin background (visible)
foreground1 (visible)
foreground2 (visible)
-->
<div id="scroller">
<div style="height: 200px; background: yellow">
<div id="foreground1"></div>
</div>
</div>
<div id="negative-margin">
<div id="foreground2"></div>
</div>
|