position-visibility-anchors-visible-after-scroll-in-document-ref.html (455B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <style> 4 #anchor { 5 width: 100px; 6 height: 100px; 7 margin-left: 150vw; 8 background: orange; 9 } 10 11 #target { 12 width: 100px; 13 height: 100px; 14 margin-top: -100px; 15 margin-left: calc(150vw - 100px); 16 background: green; 17 } 18 </style> 19 20 <div id="anchor">anchor</div> 21 <div id="target">target</div> 22 23 <script> 24 document.documentElement.scrollLeft = document.documentElement.scrollWidth; 25 </script>