W3cubDocs

/Support Tables

calc() as CSS unit value

Method of allowing calculated values for length units, i.e. width: calc(100% - 3em)

Spec https://www.w3.org/TR/css3-values/#calc
Status W3C Candidate Recommendation
IE Edge Firefox Chrome Safari Opera
    60 66    
    59 65   50
  17 58 64 TP 49
11 16 57 63 11 48
10 15 56 62 10.1 47
9 (2) 14 55 61 10 46
8 13 54 60 9.1 45
Show all
7 12 53 59 9 44
6   52 58 8 43
5.5   51 57 7.1 42
    50 56 7 41
    49 55 6.1 40
    48 54 6 (*) 39
    47 53 5.1 38
    46 52 5 37
    45 51 4 36
    44 50 3.2 35
    43 49 3.1 34
    42 48   33
    41 47   32
    40 46   31
    39 45   30
    38 44   29
    37 43   28
    36 42   27
    35 41   26
    34 40   25
    33 39   24
    32 38   23
    31 37   22
    30 36   21
    29 35   20
    28 34   19
    27 33   18
    26 32   17
    25 31   16
    24 30   15
    23 29   12.1
    22 28   12
    21 27   11.6
    20 26   11.5
    19 25 (*)   11.1
    18 24 (*)   11
    17 23 (*)   10.6
    16 22 (*)   10.5
    15 (*) 21 (*)   10.0-10.1
    14 (*) 20 (*)   9.5-9.6
    13 (*) 19 (*)   9
    12 (*) 18    
    11 (*) 17    
    10 (*) 16    
    9 (*) 15    
    8 (*) 14    
    7 (*) 13    
    6 (*) 12    
    5 (*) 11    
    4 (*) 10    
    3.6 9    
    3.5 8    
    3 7    
    2 6    
      5    
      4    
iOS Safari Opera Mini Android Browser Blackberry Browser Opera Mobile Android Chrome Android Firefox IE Mobile Android UC Browser Samsung Internet QQ Browser Baidu Browser
11.0-11.2 all 62 10 37 62 57 11 11.4 6.2 1.2 7.12
10.3   4.4.3-4.4.4 (1) 7 12.1     10   5    
10.0-10.2   4.4 (1)   12         4    
9.3   4.2-4.3   11.5              
Show all
9.0-9.2   4.1   11.1              
8.1-8.4   4   11              
8   3   10              
7.0-7.1   2.3                  
6.0-6.1 (*)   2.2                  
5.0-5.1   2.1                  
4.2-4.3                      
4.0-4.1                      
3.2                      

Notes

Support can be somewhat emulated in older versions of IE using the non-standard expression() syntax.

Due to the way browsers handle sub-pixel rounding differently, layouts using calc() expressions may have unexpected results.

  1. Partial support in Android Browser 4.4 refers to the browser lacking the ability to multiply and divide values.

  2. Partial support in IE9 refers to the browser crashing when used as a background-position value.

* Partial support with prefix.

Bugs

  • IE 9 - 11 and Edge do not support width: calc() on table cells. Bug Report

  • IE 9 - 11 don't render box-shadow when calc() is used for any of the values

  • IE10 crashes when a div with a property using calc() has a child with same property with inherit.

  • IE10, IE11, and Edge < 14 don't support using calc() inside a transform. Bug report

  • IE11 is reported to have trouble with calc() with nested expressions, e.g. width: calc((100% - 10px) / 3); (i.e. it rounds differently)

  • IE11 is reported to not support calc() correctly in generated content

  • IE11 does not support transitioning values set with calc()

  • Safari & iOS Safari (both 6 and 7) does not support viewport units (vw, vh, etc) in calc().

  • IE & Edge are reported to not support calc inside a 'flex'. (Not tested on older versions)
    This example does not work: flex: 1 1 calc(50% - 20px);

  • Firefox <48 does not support calc() inside the line-height, stroke-width, stroke-dashoffset, and stroke-dasharray properties. Bug report

  • Firefox does not support width: calc() on table cells. Bug Report

  • Firefox does not support calc() on color functions. Example: color: hsl(calc(60 * 2), 100%, 50%). Bug Report

Resources

Data by caniuse.com
Licensed under the Creative Commons Attribution License v4.0.
http://caniuse.com/#feat=calc