position-sticky-bottom-004.html (933B)
1 <!DOCTYPE html> 2 <title>CSS Position Test: sticky element with bottom offset</title> 3 <link rel="author" title="Oriol Brufau" href="obrufau@igalia.com"> 4 <link rel="help" href="https://drafts.csswg.org/css-position/#stickypos-insets"> 5 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 6 <meta name="assert" content=" 7 The static position of #sticky is outside (below) of its containing block. 8 Sticky positioning doesn't force it to move up into the containing block. 9 "> 10 11 <style> 12 #scroll-container { 13 overflow: hidden; 14 width: 100px; 15 height: 100px; 16 background: red; 17 } 18 #sticky { 19 position: sticky; 20 bottom: 0; 21 height: 100px; 22 background: green; 23 } 24 </style> 25 26 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 27 28 <div id="scroll-container"> 29 <div style="height: 100px; margin-top: -100px"> 30 <div style="height: 100px"></div> 31 <div id="sticky"></div> 32 </div> 33 </div>