The sqrt() CSS function is an exponential function that returns the square root of a number.
The function pow(x, 0.5) is equivalent to sqrt(x).
The sqrt() CSS function is an exponential function that returns the square root of a number.
The function pow(x, 0.5) is equivalent to sqrt(x).
/* A <number> value */ width: calc(100px * sqrt(9)); /* 300px */ width: calc(100px * sqrt(25)); /* 500px */ width: calc(100px * sqrt(100)); /* 1000px */
The sqrt(x) function accepts only one value as its parameter.
xA calculation which resolves to a <number> greater than or equal to 0.
Returns a <number> which is the square root of x.
x is +∞, the result is +∞.x is 0⁻, the result is 0⁻.x is less than 0, the result is NaN.| Specification |
|---|
| CSS Values and Units Module Level 4 # exponent-funcs |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
sqrt |
No | No | 112 | No | No | 15.4 | No | No | 112 | No | 15.4 | No |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/sqrt