anchor-scroll-fixedpos-004.html (856B)
1 <!DOCTYPE html> 2 3 <title>Tests that scroll compensation transform is applied before other transforms</title> 4 5 <link rel="author" href="mailto:kiet.ho@apple.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#default-scroll-shift"> 7 <link rel="match" href="reference/anchor-scroll-fixedpos-004-ref.html"> 8 9 <style> 10 body { 11 margin: 0; 12 } 13 14 div { 15 width: 100px; 16 height: 100px; 17 } 18 19 #anchor { 20 anchor-name: --a1; 21 margin-top: 105vh; 22 background: orange; 23 } 24 25 #anchored { 26 position: fixed; 27 position-anchor: --a1; 28 position-area: top right; 29 background: green; 30 color: white; 31 32 transform: scale(2); 33 } 34 </style> 35 36 <body> 37 <div id="anchor"></div> 38 <div id="anchored"></div> 39 40 <script> 41 const anchor = document.getElementById("anchor"); 42 anchor.scrollIntoView(false); 43 </script> 44 </body>