Firefox Tomorrow

web api interface

CSSNumericValue

View on MDN ↗

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
    • : Allows a CSSNumericValue to be constructed directly from a string containing CSS.

Instance methods

  • add
    • : Adds a supplied number to the CSSNumericValue.
  • sub
    • : Subtracts a supplied number from the CSSNumericValue.
  • mul
    • : Multiplies the CSSNumericValue by the supplied value.
  • div
    • : Divides the CSSNumericValue by the supplied value.
  • min
    • : Returns the minimum value passed
  • max
    • : Returns the maximum value passed
  • equals
    • : True if all the values are the exact same type and value, in the same order. Otherwise, false.
  • to
    • : Converts value into another one with the specified unit.
  • toSum
    • : Converts an existing CSSNumericValue into a CSSMathSum object with values of a specified unit.
  • type
    • : Returns the type of CSSNumericValue, one of angle, flex, frequency, length, resolution, percent, percentHint, or time.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also