3 ms·
There are soo many pointless uses of calc()… in this example `margin: 0 20px` gives identical result. In most other cases all authors really want is `box-sizin
by pornel 13y ago
There are soo many pointless uses of calc()… in this example `margin: 0 20px` gives identical result.
In most other cases all authors really want is `box-sizing: border-box` (which works in IE8+).
- richbradshaw 13y agoIs it just me, or is every insightful I come across where I nod vigorously whilst reading it turns out to be by either Mathias Bynens (seriously, that guy is everywhere!) or porneL?
- mcot2 13y agoThe real benefit is mixing percentages with pixels. This makes things like sidebars and sticky footers a breeze.
- monkeynotes 13y agoAs the OP says you can usually solve this problem by applying padding to a element that has box-sizing: border-box set. calc() will obviously have some niche uses though, and given the creativity of the industry I'm sure some neat tricks will rise out of it.
- ris 13y ago> you can usually solve this problem by applying padding to a element that has box-sizing: border-box set. And what if your element is already using padding/a border for something else and you don't want to have to fill your DOM tree with loads of pointless levels of wrapper elements?
- monkeynotes 13y agoAs I say, you can usually solve your problem this way.
- stesch 13y agoEven on the linked documentation page for cal(). I don't really see a reason for this feature.