OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 | |
3 <html> | |
4 <head> | |
5 <style> | |
6 body { | |
7 margin: 0; | |
8 height: 2000px; | |
9 overflow: hidden; /* hide scrollbars */ | |
10 font-family: 'Ahem'; | |
11 font-size: 25px; | |
12 line-height: 2; | |
13 } | |
14 | |
15 .group { | |
16 display: inline-block; | |
17 position: relative; | |
18 width: 220px; | |
19 height: 500px; | |
20 } | |
21 | |
22 .container { | |
23 width: 200px; | |
24 height: 400px; | |
25 outline: 2px solid black; | |
26 } | |
27 | |
28 .box { | |
29 width: 200px; | |
30 height: 200px; | |
31 } | |
32 | |
33 .sticky { | |
34 width: 200px; | |
35 height: 200px; | |
36 color: blue; | |
37 position: relative; | |
38 } | |
39 | |
40 .child { | |
41 position: absolute; | |
42 background-color: green; | |
43 top: 50px; | |
44 left: 50px; | |
45 height: 50px; | |
46 width: 50px; | |
47 } | |
48 | |
49 .indicator { | |
50 display: none; | |
51 position: absolute; | |
52 top: 250px; | |
53 left: 50px; | |
54 background-color: red; | |
55 } | |
56 </style> | |
57 </head> | |
58 <body> | |
59 <div class="group" style="top: -100px"> | |
60 <div class="indicator box"></div> | |
61 <div class="container"> | |
62 XXX <span class="sticky" style="top: 163px;">XXXX</br> | |
63 <div class="child box"></div> | |
64 XXXX</br>XXXX</br>XXXX</br>XXXX</span> XXX | |
65 </div> | |
66 </div> | |
67 <div class="group" style="top: 0"> | |
68 <div class="indicator box"></div> | |
69 <div class="container"> | |
70 XXX <span class="sticky" style="top: 88px;">XXXX</br> | |
71 <div class="child box"></div> | |
72 XXXX</br>XXXX</br>XXXX</br>XXXX</span> XXX | |
73 </div> | |
74 </div> | |
75 <div class="group" style="top: 100px"> | |
76 <div class="indicator box"></div> | |
77 <div class="container"> | |
78 XXX <span class="sticky" style="top: 0;">XXXX</br> | |
79 <div class="child box"></div> | |
80 XXXX</br>XXXX</br>XXXX</br>XXXX</span> XXX | |
81 </div> | |
82 </div> | |
83 | |
84 </body> | |
85 </html> | |
OLD | NEW |