OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <head> | 2 <head> |
3 <style> | 3 <style> |
4 .composited { | |
5 transform: translatez(0); | |
6 } | |
7 | |
8 .box { | 4 .box { |
9 width: 100px; | 5 width: 100px; |
10 height: 100px; | 6 height: 100px; |
11 } | 7 } |
12 | 8 |
13 .behind { | 9 .behind { |
14 position: absolute; | 10 position: absolute; |
15 z-index: 1; | |
16 top: 100px; | 11 top: 100px; |
17 left: 100px; | 12 left: 100px; |
18 background-color: blue; | 13 background-color: blue; |
19 } | 14 } |
20 | 15 |
21 .middle { | 16 .middle { |
22 position: absolute; | 17 position: absolute; |
23 z-index: 1; | |
24 top: 180px; | 18 top: 180px; |
25 left: 180px; | 19 left: 180px; |
26 background-color: lime; | 20 background-color: lime; |
27 } | 21 } |
28 | 22 |
29 .repaintdiv { | 23 .repaintdiv { |
30 position: absolute; | 24 position: absolute; |
31 z-index: 1; | |
32 top: 260px; | 25 top: 260px; |
33 left: 260px; | 26 left: 260px; |
34 width: 182px; | 27 width: 182px; |
35 height: 29px; | 28 height: 29px; |
36 background-color: salmon; | 29 background-color:salmon; |
37 } | 30 } |
38 | 31 |
39 .top { | 32 .top { |
40 position: absolute; | 33 position: absolute; |
41 z-index: 1; | |
42 top: 280px; | 34 top: 280px; |
43 left: 340px; | 35 left: 340px; |
44 background-color: cyan; | 36 background-color: cyan; |
45 } | 37 } |
46 | 38 |
47 div:hover { | |
48 background-color: green; | |
49 transform:translatez(0); | |
50 } | |
51 | |
52 </style> | 39 </style> |
53 </head> | 40 </head> |
54 <body> | 41 <body> |
55 <div class="composited box behind"></div> | 42 <div class="box behind"></div> |
56 <div class="box middle"></div> | 43 <div class="box middle"></div> |
57 <img id="repaintdiv" class="repaintdiv"></img> | 44 <img id="repaintdiv" class="repaintdiv"></img> |
58 <div class="box top"></div> | 45 <div class="box top"></div> |
59 </body> | 46 </body> |
OLD | NEW |