OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 body { |
| 6 margin: 0; |
| 7 height: 2000px; |
| 8 overflow: hidden; /* hide scrollbars */ |
| 9 } |
| 10 |
| 11 .group { |
| 12 display: inline-block; |
| 13 position: relative; |
| 14 width: 250px; |
| 15 height: 500px; |
| 16 } |
| 17 |
| 18 .container { |
| 19 width: 200px; |
| 20 height: 400px; |
| 21 outline: 2px solid black; |
| 22 } |
| 23 |
| 24 .box { |
| 25 width: 200px; |
| 26 height: 200px; |
| 27 } |
| 28 |
| 29 .sticky { |
| 30 position: absolute; |
| 31 background-color: green; |
| 32 } |
| 33 |
| 34 .indicator { |
| 35 position: absolute; |
| 36 top: 0; |
| 37 left: 0; |
| 38 background-color: red; |
| 39 } |
| 40 </style> |
| 41 </head> |
| 42 <body> |
| 43 <div class="group" style="top: -100px;"> |
| 44 <div class="indicator box" style="top: 200px;"></div> |
| 45 <div class="container"> |
| 46 <div class="sticky box" style="top: 200px;"></div> |
| 47 </div> |
| 48 </div> |
| 49 |
| 50 <div class="group" style="top: 0"> |
| 51 <div class="indicator box" style="top: 100px;"></div> |
| 52 <div class="container"> |
| 53 <div class="sticky box" style="top: 100px;"></div> |
| 54 </div> |
| 55 </div> |
| 56 |
| 57 <div class="group" style="top: 100px"> |
| 58 <div class="indicator box" style="top: 0;"></div> |
| 59 <div class="container"> |
| 60 <div class="sticky box" style="top: 0;"></div> |
| 61 </div> |
| 62 </div> |
| 63 <div style="position: absolute; top: 520px;"> |
| 64 This test checks that sticky positioned table rows are contained by their ta
ble. |
| 65 There should be no red. |
| 66 </div> |
| 67 </body> |
| 68 </html> |
OLD | NEW |