padding-3-ref.html (889B)
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 <link rel="author" title="Corey Ford" href="mailto:cford@mozilla.com"> 7 <style> 8 body { 9 font-size: 0px; 10 } 11 #scroll { 12 width: 80px; 13 height: 80px; 14 overflow: scroll; 15 border: 10px solid black; 16 padding: 10px; 17 } 18 #inner { 19 position: relative; 20 width: 100%; 21 height: 100%; 22 } 23 #sticky { 24 position: absolute; 25 width: 10px; 26 height: 10px; 27 bottom: 20px; 28 right: 20px; 29 background-color: black; 30 } 31 </style> 32 <body> 33 <div id="scroll"> 34 <div id="inner"> 35 <div style="width: 110px; height: 110px"></div> 36 <div id="sticky"></div> 37 </div> 38 </div> 39 </body> 40 </html>