---
title: CSSNumericValue
slug: Web/API/CSSNumericValue
tags:
- API
- CSS Typed Object Model API
- CSSNumericValue
- Experimental
- Houdini
- Interface
- NeedsTranslation
- Reference
- TopicStub
translation_of: Web/API/CSSNumericValue
---
{{draft}}{{APIRef("CSS Typed OM")}}{{SeeCompatTable}}
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.
- {{domxref('CSSMathInvert')}}
- {{domxref('CSSMathMax')}}
- {{domxref('CSSMathMin')}}
- {{domxref('CSSMathNegate')}}
- {{domxref('CSSMathProduct')}}
- {{domxref('CSSMathSum')}}
- {{domxref('CSSMathValue')}}
- {{domxref('CSSNumericArray')}}
- {{domxref('CSSPerspective')}}
- {{domxref('CSSPositionValue')}}
- {{domxref('CSSRotate')}}
- {{domxref('CSSSkew')}}
- {{domxref('CSSSkeyX')}}
- {{domxref('CSSSkeyW')}}
- {{domxref('CSSTranslate')}}
- {{domxref('CSSUnitValue')}}
Properties
None.
Event handlers
No
Methods
- {{domxref('CSSNumericValue.add')}}
- Adds a supplied number to the
CSSNumericValue
.
- {{domxref('CSSNumericValue.sub')}}
- Subtracts a supplied number from the
CSSNumericValue
.
- {{domxref('CSSNumericValue.mul')}}
- Multiplies the
CSSNumericValue
by the supplied value.
- {{domxref('CSSNumericValue.div')}}
- Divides the
CSSNumericValue
by the supplied value.
- {{domxref('CSSNumericValue.min')}}
- Returns the minimum value passed
- {{domxref('CSSNumericValue.max')}}
- Returns the maximum value passed
- {{domxref('CSSNumericValue.equals')}}
- True if all the values are the exact same type and value, in the same order. Otherwise, false.
- {{domxref('CSSNumericValue.to')}}
- Converts
value
into another one with the specified unit.
- {{domxref('CSSNumericValue.toSum')}}
- TBD
- {{domxref('CSSNumericValue.type')}}
- TBD
- {{domxref('CSSNumericValue.parse')}}
- Allows a
CSSNumericValue
to be constructed directly from a string containing CSS.
Specifications
Specification |
Status |
Comment |
{{SpecName('CSS Typed OM','#numeric-value','CSSNumericValue')}} |
{{Spec2('CSS Typed OM')}} |
Initial definition. |
Browser compatibility
{{Compat("api.CSSNumericValue")}}
See Also
- {{domxref('CSSImageValue')}}
- {{domxref('CSSKeywordValue')}}
- {{domxref('CSSPositionValue')}}
- {{domxref('CSSTransformValue')}}
- {{domxref('CSSUnparsedValue')}}