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