OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <style> | 5 <style> |
6 #container { | 6 #container { |
7 width: 200px; | 7 width: 200px; |
8 height: 200px; | 8 height: 200px; |
9 overflow: hidden; | 9 overflow: hidden; |
10 border: 1px solid black; | 10 border: 1px solid black; |
11 } | 11 } |
12 | 12 |
13 .scroll-content { | 13 .scroll-content { |
14 height: 600px; | 14 height: 600px; |
15 } | 15 } |
16 | 16 |
17 .inner { | 17 .inner { |
18 position: relative; | 18 position: relative; |
19 width: 150px; | 19 width: 150px; |
20 height: 150px; | 20 height: 150px; |
21 margin-top: -10px; /* force overlap with the composited element */ | 21 margin-top: -10px; /* force overlap with the composited element */ |
22 margin-left: 10px; | 22 margin-left: 10px; |
23 box-sizing: border-box; | 23 box-sizing: border-box; |
24 border: 40px solid black; | 24 border: 40px solid black; |
25 } | 25 } |
26 | 26 |
27 .composited { | 27 .composited { |
28 height: 50px; | 28 height: 50px; |
29 width: 100px; | 29 width: 100px; |
30 -webkit-transform: translateZ(0); | 30 transform: translateZ(0); |
31 } | 31 } |
32 </style> | 32 </style> |
33 </head> | 33 </head> |
34 <body> | 34 <body> |
35 | 35 |
36 <div id="container"> | 36 <div id="container"> |
37 <div class="scroll-content"> | 37 <div class="scroll-content"> |
38 <div class="composited"></div> | 38 <div class="composited"></div> |
39 <div class="inner"></div> | 39 <div class="inner"></div> |
40 </div> | 40 </div> |
41 </div> | 41 </div> |
42 </body> | 42 </body> |
43 </html> | 43 </html> |
OLD | NEW |