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