I have the following css:
#elementid {
width: -webkit-calc(100% - 30px);
width: -moz-calc(100% - 30px);
width: -o-calc(100% - 30px);
width: calc(100% - 30px);
}
The element renders narrower than expected . In Chrome, if I inspect the element, it shows:
width: -webkit-calc(70%);
width: -moz-calc(70%);
width: -o-calc(70%);
width: calc(70%);
So it's apparently interpreted the 'px' as % instead.
But if I enter the exact same CSS inline on the element, in Chrome dev tools:
width: calc(100% - 30px);
... then it renders as I expect.
As you can see I added spaces around the operator properly, so that's not it.
Why would the browser interpret it as "calc(70%)" when rendering the page, but not when I change the CSS inline using dev tools?