Re:CSS Absolute Centering
by ianstormtaylor on Saturday August 10, 2013 @04:48PM
(#6192627)
It's not about inheritance, it's about specificity. If you have a generic module that specifies
And you actually the bottom of your element to have more padding, you need to be able to do adjust the bottom padding independently
Otherwise, you'd be required to tightly couple your our padding requirements with the defaults of the original module
[ Parent
| on HN ]
CSS 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.)
Re:CSS Absolute Centering
by callmevlad on Saturday August 10, 2013 @06:16PM
(#6192879)
If you set box-sizing: border-box [1], you don't need to worry about the latter.
Even without border box you can achieve that quite easily (since the conceptual border-box 100% is the default for blocks); you simply need more wrapper elements.