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