scroller-child-abspos-ref.html (651B)
1 <!DOCTYPE html> 2 <title>View transitions: scroller child element (ref)</title> 3 <link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/"> 4 <link rel="author" href="mailto:vmpstr@chromium.org"> 5 6 <style> 7 #target { 8 width: 200px; 9 height: 200px; 10 background: yellow; 11 } 12 #scroller { 13 overflow: scroll; 14 width: 100px; 15 height: 100px; 16 background: blue; 17 isolation: isolate; 18 } 19 20 #child { 21 position: absolute; 22 width: 100px; 23 height: 100px; 24 background: green; 25 top: 200px; 26 } 27 </style> 28 29 <div id="target"> 30 <div id="scroller"> 31 <div id="child"></div> 32 </div> 33 </div> 34 35 <script> 36 onload = () => { scroller.scrollTop = 300; }; 37 </script>