Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style>
div.scrolling-container
{
display: inline-block;
height: 250px;
margin-right: 30px;
overflow: auto;
position: static;
width: 150px;
}
div.vertical-spacer-200
{
height: 200px;
}
div.sticky
{
background-color: green;
height: 100px;
position: relative;
width: 100px;
}
div#first-sticky
{
bottom: 100px;
}
div#second-sticky
{
bottom: 50px;
}
</style>
<body onload="document.getElementById(&quot;first-scrolling-container&quot;).scrollTop = 25; document.getElementById(&quot;second-scrolling-container&quot;).scrollTop = 100; document.getElementById(&quot;third-scrolling-container&quot;).scrollTop = 200;">
<p>Test passes if there are 3 filled green squares and <strong>no red</strong>.
<div id="first-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport -->
<div class="vertical-spacer-200"></div> <!-- 100w x 200h -->
<div id="first-sticky" class="sticky"></div> <!-- 100w x 100h -->
<div class="vertical-spacer-200"></div> <!-- 100w x 200h -->
</div>
<div id="second-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport -->
<div class="vertical-spacer-200"></div> <!-- 100w x 200h -->
<div id="second-sticky" class="sticky"></div> <!-- 100w x 100h -->
<div class="vertical-spacer-200"></div> <!-- 100w x 200h -->
</div>
<div id="third-scrolling-container" class="scrolling-container"> <!-- 150w x 250h viewport -->
<div class="vertical-spacer-200"></div> <!-- 100w x 200h -->
<div id="third-sticky" class="sticky"></div> <!-- 100w x 100h -->
<div class="vertical-spacer-200"></div> <!-- 100w x 200h -->
</div>