CSSMathClamp: CSSMathClamp() constructor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The CSSMathClamp() constructor creates a
new CSSMathClamp object representing a CSS clamp() function.
Syntax
js
new CSSMathClamp(lower, value, upper)
Parameters
lower-
A
CSSNumericValueobject – either a number orCSSUnitValue– representing the minimum value. value-
A
CSSNumericValueobject – either a number orCSSUnitValue– representing the preferred value. upper-
A
CSSNumericValueobject – either a number orCSSUnitValue– representing the maximum value.
Exceptions
TypeError-
Thrown if there is a failure when adding the three arguments.
Examples
To do
Specifications
| Specification |
|---|
| CSS Typed OM Level 1 # dom-cssmathclamp-cssmathclamp |
Browser compatibility
| desktop | mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
CSSMathClamp() constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.