Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
1 <!DOCTYPE html>
2 <!-- Any copyright is dedicated to the Public Domain.
3 - http://creativecommons.org/publicdomain/zero/1.0/ -->
4 <!-- Percentage sticky offsets should be computed correctly when
5 - the scroll container is auto-sized -->
6 <html>
7 <head>
8 <link rel="author" title="Corey Ford" href="mailto:cford@mozilla.com">
9 <style>
10 body {
11 overflow: scroll;
12 }
13 #scroll {
14 height: auto;
15 overflow: hidden;
16 border: 1px solid black;
17 }
18 #sticky {
19 position: relative;
20 height: 10px;
21 top: 105px;
22 background-color: black;
23 }
24 .fill {
25 height: 200px;
26 }
27 </style>
28 <body>
29 <div id="scroll">
30 <div id="sticky"></div>
31 <div class="fill"></div>
32 </div>
33 </body>
34 </html>