initial-scroll-1.html (1034B)
1 <!DOCTYPE html> 2 <!-- Any copyright is dedicated to the Public Domain. 3 - http://creativecommons.org/publicdomain/zero/1.0/ --> 4 <html> 5 <head> 6 <title>CSS Test: Sticky Positioning - initial scroll position</title> 7 <link rel="author" title="Corey Ford" href="mailto:cford@mozilla.com"> 8 <link rel="match" href="initial-scroll-1-ref.html"> 9 <meta name="assert" content="When the initial scroll position of the scroll container is not (0, 0), a sticky element inside it should be positioned correctly"> 10 <style> 11 #scroll { 12 width: 100px; 13 height: 100px; 14 overflow: hidden; 15 direction: rtl; 16 } 17 #inner { 18 width: 200px; 19 height: 200px; 20 direction: ltr; 21 } 22 #sticky { 23 position: sticky; 24 left: 10px; 25 width: 10px; 26 height: 10px; 27 background-color: black; 28 } 29 </style> 30 <body> 31 <div id="scroll"> 32 <div id="inner"> 33 <div id="sticky"> 34 </div> 35 </div> 36 </div> 37 </body> 38 </html>