anchor-pos-sticky-4-ref.html (471B)
1 <!DOCTYPE html> 2 <html> 3 <style> 4 .anchor2 { 5 position: absolute; 6 width: 50px; 7 height: 50px; 8 background: pink; 9 left: 0; 10 top: 0; 11 } 12 .anchor1 { 13 width: 50px; 14 height: 50px; 15 background: blue; 16 position: absolute; 17 left: 50px; 18 top: 50px; 19 } 20 .anchored { 21 position: absolute; 22 width: 50px; 23 height: 50px; 24 background: yellow; 25 left: 100px; 26 top: 100px; 27 } 28 </style> 29 <div class="anchor2"></div> 30 <div class="anchor1"></div> 31 <div class="anchored"></div> 32 </html>