Search code examples
cssfirefoxwidthcalc

width: calc() not working in Firefox


I have the following CSS properties on an item:

width: calc(100%- 40px);
width: -moz-calc(100% - 40px);

but Firefox is saying that they are both invalid property values. Is this a bug with Firefox, or is there a new way to do width: calc in Firefox?


Solution

  • -moz-calc CSS function has been removed with Firefox 53. Just use calc and make sure you have white space between parameters:

    correct:

    width: calc(100% - 40px);
    

    incorrect:

    width: calc(100%- 40px);