When using overflow: scroll combined with padding: /* ... */ CSS property, the padding at the bottom of the element is missing in Firefox. (But works in Chrome and Safari.)
overflow: scroll
padding: /* ... */
.container { height: 100px; padding: 50px; border: solid 1px red; overflow-y: scroll; } ul, li { padding: 0; margin: 0; }
<div class="container"> <ul> <li>padding above first line in every Browser</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>content</li> <li>no padding after last line in Firefox</li> </ul> </div>
After a bit of brainstorming with fellow developers, although not very graceful, this pure css solution works:
.container:after { content: ""; height: 50px; display: block; }
2.1m questions
2.1m answers
60 comments
57.0k users