Search code examples
htmlcssfirefoxoverflowpadding

No padding when using overflow: auto


I can’t get padding-bottom to work when I use overflow-y: auto on a box. I use Firefox.

#container {
  padding: 3em;
  overflow-x: hidden;
  overflow-y: auto;
  width: 300px;
  height: 300px;
  background: red;
}

#some_info {
  height: 900px;
  background: #000;
}
<div id="container">
  <div id="some_info"></div>
</div>

See the JSFiddle.


Solution

  • One more solution without extra DIVs.

    #container:after {
      content: "";
      display: block;
      height: 50px;
      width: 100%;
    }
    

    Working in FF, Chrome, IE8-10.