The CSSNumericValue interface of the CSS Typed Object Model API represents operations that all numeric values can perform.
The CSSNumericValue interface of the CSS Typed Object Model API represents operations that all numeric values can perform.
Below is a list of interfaces based on the CSSNumericValue interface.
None.
CSSNumericValue.parseAllows a CSSNumericValue to be constructed directly from a string containing CSS.
CSSNumericValue.addAdds a supplied number to the CSSNumericValue.
CSSNumericValue.subSubtracts a supplied number from the CSSNumericValue.
CSSNumericValue.mulMultiplies the CSSNumericValue by the supplied value.
CSSNumericValue.divDivides the CSSNumericValue by the supplied value.
CSSNumericValue.minReturns the minimum value passed
CSSNumericValue.maxReturns the maximum value passed
CSSNumericValue.equalsTrue if all the values are the exact same type and value, in the same order. Otherwise, false.
CSSNumericValue.toConverts value into another one with the specified unit.
CSSNumericValue.toSumConverts an existing CSSNumericValue into a CSSMathSum object with values of a specified unit.
CSSNumericValue.typeReturns the type of CSSNumericValue, one of angle, flex, frequency, length, resolution, percent, percentHint, or time.
| Specification |
|---|
| CSS Typed OM Level 1 # numeric-value |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
CSSNumericValue |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
add |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
div |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
equals |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
max |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
min |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
mul |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
parse_static |
66Not exposed to PaintWorklet. |
79Not exposed to PaintWorklet. |
No | No | 53Not exposed to PaintWorklet. |
16.4 | 66Not exposed to PaintWorklet. |
66Not exposed to PaintWorklet. |
No | 47Not exposed to PaintWorklet. |
16.4 | 9.0Not exposed to PaintWorklet. |
sub |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
to |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
toSum |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
type |
66 | 79 | No | No | 53 | 16.4 | 66 | 66 | No | 47 | 16.4 | 9.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue