background-attachment-fixed-inline-scrolled.html (1154B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#background-attachment"> 4 <link rel="match" href="background-attachment-fixed-inline-scrolled-ref.html"> 5 <meta name="assert" content="Background with background-attachment-fixed on an inline element should be fixed to the viewport"> 6 <style> 7 body { 8 /* suppress scrollbars */ 9 overflow: hidden; 10 } 11 #target { 12 background-attachment: fixed; 13 background-image: linear-gradient(green 50%, yellow 50%); 14 font-size: 130px; 15 line-height: 100px; 16 } 17 </style> 18 <span id="target"> 19 <br> 20 <br> 21 <br> 22 <br> 23 <br> 24 <br> 25 <br> 26 <br> 27 </span> 28 <script> 29 requestAnimationFrame(() => { 30 requestAnimationFrame(() => { 31 scrollTo(0, 300); 32 document.documentElement.classList.remove("reftest-wait"); 33 }); 34 }); 35 </script>