scrollbars.html (1048B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez"> 4 <link rel="author" href="https://mozilla.org" title="Mozilla"> 5 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1873301"> 6 <link rel="help" href="https://html.spec.whatwg.org/#button-layout"> 7 <link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html"> 8 <title>Buttons support being scrolled</title> 9 <style> 10 button { 11 display: block; 12 width: 100px; 13 height: 100px; 14 background-color: red; 15 border: 0; 16 padding: 0; 17 margin: 0; 18 overflow: auto; 19 scrollbar-width: none; 20 } 21 .filler { 22 display: block; 23 background: red; 24 height: 400px; 25 } 26 .inner { 27 display: block; 28 width: 100px; 29 height: 100px; 30 background-color: green; 31 } 32 </style> 33 <p>Test passes if there is a filled green square.</p> 34 <button> 35 <span class="filler"></span> 36 <span class="inner"></span> 37 </button> 38 <script> 39 document.querySelector("button").scrollTop = 400; 40 </script>