4 ms·
It's not about inheritance, it's about specificity. If you have a generic module that specifies padding: 5px; And you actually the bottom of your element to
by ianstormtaylor 13y ago
It's not about inheritance, it's about specificity. If you have a generic module that specifies
padding: 5px;
And you actually the bottom of your element to have more padding, you need to be able to do adjust the bottom padding independently
padding-bottom: 10px;
Otherwise, you'd be required to tightly couple your our padding requirements with the defaults of the original module
padding: 5px 5px 10px 5px;
- lmm 13y agoCSS requires you to do that in plenty of other places (e.g. if you make your border 1px wider you have to make the element it's on 2px narrower.)
- callmevlad 13y agoIf you set box-sizing: border-box [1], you don't need to worry about the latter.