Firefox (apparently) renders display: table-row a little differently than other browsers. Since #scroll-w had height: 100% and #scroll-h had height: 100% with padding: 5px, then the total height of #scroll-h ended up being "100% of #scroll-w's height plus 10 pixels". Applying -moz-box-sizing: border-box to #scroll-h causes firefox to calculate the height of #scroll-h to be 100% of #scroll-w's height, no matter what extra padding (or borders) are added. Note that applying this same style to chrome/safari (with box-sizing: border-box) breaks #scroll-h's height and causes it to be too short.
Firefox (apparently) renders
display: table-row
a little differently than other browsers. Since#scroll-w
hadheight: 100%
and#scroll-h
hadheight: 100%
withpadding: 5px
, then the total height of#scroll-h
ended up being "100% of #scroll-w's height plus 10 pixels". Applying-moz-box-sizing: border-box
to #scroll-h causes firefox to calculate the height of#scroll-h
to be 100% of#scroll-w
's height, no matter what extra padding (or borders) are added. Note that applying this same style to chrome/safari (withbox-sizing: border-box
) breaks#scroll-h
's height and causes it to be too short.