Firefox Tomorrow

web api instance method

CSSNumericValue: div() method

View on MDN ↗

The div() method of the CSSNumericValue interface divides the CSSNumericValue by the supplied value.

Syntax

div(number)

Parameters

Return value

A CSSMathProduct.

Exceptions

  • TypeError
    • : Thrown if an invalid type was passed to the method.

Examples

let mathProduct = CSS.px("24").div(CSS.percent("4"));
// Prints "calc(24px / 4%)"
mathProduct.toString();

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.