CSSNumericValue
Experimental: 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.
Instance properties
None.
Static methods
CSSNumericValue.parse
Experimental-
Allows a
CSSNumericValue
to be constructed directly from a string containing CSS.
Instance methods
CSSNumericValue.add
Experimental-
Adds a supplied number to the
CSSNumericValue
. CSSNumericValue.sub
Experimental-
Subtracts a supplied number from the
CSSNumericValue
. CSSNumericValue.mul
Experimental-
Multiplies the
CSSNumericValue
by the supplied value. CSSNumericValue.div
Experimental-
Divides the
CSSNumericValue
by the supplied value. CSSNumericValue.min
Experimental-
Returns the minimum value passed
CSSNumericValue.max
Experimental-
Returns the maximum value passed
CSSNumericValue.equals
Experimental-
True if all the values are the exact same type and value, in the same order. Otherwise, false.
CSSNumericValue.to
Experimental-
Converts
value
into another one with the specified unit. CSSNumericValue.toSum
Experimental-
Converts an existing
CSSNumericValue
into aCSSMathSum
object with values of a specified unit. CSSNumericValue.type
Experimental-
Returns the type of
CSSNumericValue
, one ofangle
,flex
,frequency
,length
,resolution
,percent
,percentHint
, ortime
.
Specifications
Specification |
---|
CSS Typed OM Level 1 # numeric-value |
Browser compatibility
BCD tables only load in the browser