I'm using the following calc() equation to calculate the width of two divs:
CSS
.MyClass {
width: calc((100% - 800px) / 2);
width: -moz-calc((100% - 800px) / 2);
width: -webkit-calc((100% - 800px) / 2);
}
This works fine for Chrome and IE, but not Firefox and Safari. I've noticed that Firefox seems unable to interpret the percentage. For example the following will display fine:
CSS
width: calc((1000px - 800px) / 2);
Any advice?
Thanks.
Update
So out my pre-processor is creating css that looks like this:
SCSS
.MyClass {
width: calc( ( 100% - #{$WrapperWidth} ) / 2 ) ;
width: -moz-calc( ( 100% - #{$WrapperWidth} ) / 2 ) ;
width: -webkit-calc( ( 100% - #{$WrapperWidth} ) / 2 ) ;
}
CSS
.MyClass {
width: calc( ( 100% - 800px ) / 2);
width: -moz-calc(100%-800px/2);
width: -webkit-calc(100%-800px/2);
}
I've tried correcting it but it still doesn't seem to be working. The code from the browser is still:
width: calc((100% - 800px) / 2);
It doesn't seem to be reading the -moz-calc though.