CSSNumericValue

You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!

Draft
This page is not complete.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The CSSNumericValue interface of the CSS Typed Object Model API represents operations that all numeric values can perform.

Interfaces based on CSSNumericValue

Below is a list of interfaces based on the CSSNumericValue interface.

Properties

None.

Event handlers

No

Methods

CSSNumericValue.add
Adds a supplied number to the CSSNumericValue.
CSSNumericValue.sub
Subtracts a supplied number from the CSSNumericValue.
CSSNumericValue.mul
Multiplies the CSSNumericValue by the supplied value.
CSSNumericValue.div
Divides the CSSNumericValue by the supplied value.
CSSNumericValue.min
Returns the minimum value passed
CSSNumericValue.max
Returns the maximum value passed
CSSNumericValue.equals
True if all the values are the exact same type and value, in the same order. Otherwise, false.
CSSNumericValue.to
Converts value into another one with the specified unit.
CSSNumericValue.toSum
TBD
CSSNumericValue.type
TBD
CSSNumericValue.parse
Allows a CSSNumericValue to be constructed directly from a string containing CSS. 

Specifications

Specification Status Comment
CSS Typed OM Level 1
The definition of 'CSSNumericValue' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
CSSNumericValue
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
add
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
div
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
equals
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
max
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
min
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
mul
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
parse
Experimental
Chrome Full support 66
Notes
Full support 66
Notes
Notes Not exposed to PaintWorklet.
Edge No support NoFirefox No support NoIE No support NoOpera Full support 53
Notes
Full support 53
Notes
Notes Not exposed to PaintWorklet.
Safari No support NoWebView Android Full support 66
Notes
Full support 66
Notes
Notes Not exposed to PaintWorklet.
Chrome Android Full support 66
Notes
Full support 66
Notes
Notes Not exposed to PaintWorklet.
Firefox Android No support NoOpera Android Full support 47
Notes
Full support 47
Notes
Notes Not exposed to PaintWorklet.
Safari iOS No support NoSamsung Internet Android Full support Yes
sub
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
to
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
toSum
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes
type
Experimental
Chrome Full support 66Edge No support NoFirefox No support NoIE No support NoOpera Full support 53Safari No support NoWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

See Also