OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <style> | 2 <style> |
3 .flex-item { | 3 .flex-item { |
4 width: 50px; | 4 width: 50px; |
5 height: 50px; | 5 height: 50px; |
6 } | 6 } |
7 .positioned { | 7 .positioned { |
8 position: absolute; | 8 position: absolute; |
9 left: 25px; | 9 left: 25px; |
10 height: 25px; | 10 height: 25px; |
11 width: 50px; | 11 width: 50px; |
12 } | 12 } |
13 </style> | 13 </style> |
14 <div>This tests that z-index on non-positioned flex-items works. The green boxes
should be above the orange boxes, which should be above the purple boxes, which
are above the salmon boxes.<div> | 14 <div>This tests that z-index on non-positioned flex-items works. The green boxes
should be above the orange boxes, which should be above the purple boxes, which
are above the salmon boxes.<div> |
15 <div style="position:relative"> | 15 <div style="position:relative"> |
16 <div style="display:-webkit-flex;"> | 16 <div style="display:flex;"> |
17 <div class="flex-item" style="z-index: 1; background-color: salmon;"></d
iv> | 17 <div class="flex-item" style="z-index: 1; background-color: salmon;"></d
iv> |
18 <div class="flex-item" style="z-index: 100; background-color: orange;"><
/div> | 18 <div class="flex-item" style="z-index: 100; background-color: orange;"><
/div> |
19 </div> | 19 </div> |
20 <div class="positioned" style="top: 0; z-index: 150; background-color: green
"></div> | 20 <div class="positioned" style="top: 0; z-index: 150; background-color: green
"></div> |
21 <div class="positioned" style="top: 25px; z-index: 50; background-color: pur
ple"></div> | 21 <div class="positioned" style="top: 25px; z-index: 50; background-color: pur
ple"></div> |
22 </div> | 22 </div> |
23 <div style="position:relative"> | 23 <div style="position:relative"> |
24 <div style="display:-webkit-flex;"> | 24 <div style="display:flex;"> |
25 <img class="flex-item" style="z-index: 1; background-color: salmon;"></i
mg> | 25 <img class="flex-item" style="z-index: 1; background-color: salmon;"></i
mg> |
26 <img class="flex-item" style="z-index: 100; background-color: orange;"><
/img> | 26 <img class="flex-item" style="z-index: 100; background-color: orange;"><
/img> |
27 </div> | 27 </div> |
28 <img class="positioned" style="top: 0; z-index: 150; background-color: green
"></img> | 28 <img class="positioned" style="top: 0; z-index: 150; background-color: green
"></img> |
29 <img class="positioned" style="top: 25px; z-index: 50; background-color: pur
ple"></img> | 29 <img class="positioned" style="top: 25px; z-index: 50; background-color: pur
ple"></img> |
30 </div> | 30 </div> |
OLD | NEW |