massive-element-on-top-of-viewport-partially-onscreen-ref.html (1144B)
1 <!DOCTYPE html> 2 <title>View transitions: massive element on top of viewport partially onscreen (ref)</title> 3 <link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> 4 <link rel="author" href="mailto:khushalsagar@chromium.org"> 5 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 6 <style> 7 :root { 8 font: 12px/1 Ahem; 9 } 10 11 .target { 12 contain: paint; 13 inline-size: 100px; 14 block-size: 40000px; 15 view-transition-name: target; 16 } 17 18 .top { 19 inline-size: 100%; 20 block-size: 100px; 21 background: lightblue; 22 } 23 24 .middle { 25 inline-size: 100%; 26 block-size: 39800px; 27 background: green; 28 } 29 30 .bottom { 31 inline-size: 100%; 32 block-size: 100px; 33 background: blue; 34 } 35 36 .hidden { 37 contain: paint; 38 inline-size: 10px; 39 block-size: 10px; 40 background: grey; 41 visibility: hidden; 42 } 43 </style> 44 <body> 45 <div class="target"> 46 <div class="top">This text is at the top of the box</div> 47 <div class="middle">This text is in the middle of the box</div> 48 <div id="scrollblue" class="bottom">This text is at the bottom of the box</div> 49 </div> 50 <div id=hidden class=hidden></div> 51 </body> 52 <script> 53 scrollblue.scrollIntoView(); 54 </script>