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