Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<style>
  .container {
    width: 100px;
    height: 100px;
    overflow-y: scroll;
    /**
     * The scroll container background color can affect whether we use light
     * or dark scrollbars. Use the same color as the test to ensure they match
     **/
    background: red;
    display: inline-block;
  }
  .container div {
    background: lightgreen;
  }
</style>
<div class="container">
  <div style="height: calc(300px + 50px + 10.10px);"></div>
</div>
<div class="container">
  <div style="height: calc(300px + 50px + 10.25px);"></div>
</div>
<div class="container">
  <div style="height: calc(300px + 50px + 10.50px);"></div>
</div>
<div class="container">
  <div style="height: calc(300px + 50px + 10.75px);"></div>
</div>
<div class="container">
  <div style="height: calc(300px + 50px + 10.90px);"></div>
</div>
<script>
  window.onload = function() {
    var containers = document.getElementsByClassName('container');
    for (let i = 0; i < containers.length; i++) {
      containers[i].scrollTo(0, 20);
    }
  };
</script>
</html>