CSS sqrt() functie

definitie en gebruik

CSS sqrt() De functie retourneert de kwadratwortel van een getal.

voorbeeld

in calc() gebruikt in de functie sqrt() Stel de breedte en hoogte van de drie <div>-elementen in:

div.a {
  width: calc(50px * sqrt(16)); /* 200px */
  height: calc(50px * sqrt(9)); /* 150px */
  background-color: salmon;
  margin-bottom: 25px;
}
div.b {
  width: calc(20px * sqrt(16)); /* 80px */
  height: calc(20px * sqrt(9)); /* 60px */
  background-color: green;
  margin-bottom: 25px;
}
div.c {
  width: calc(60px * sqrt(16)); /* 240px */
  height: calc(60px * sqrt(9)); /* 180px */
  background-color: maroon;
}

Probeer het zelf

CSS syntaxis

sqrt(x)
Waarde Beschrijving
x Verplicht. Een getal groter dan of gelijk aan 0.

Technische details

Versie: CSS4

Browserondersteuning

De cijfers in de tabel geven de browserversie aan die de functie volledig ondersteunt.

Chrome Edge Firefox Safari Opera
120 120 118 15.4 106

gerelateerde pagina's

Referentie:CSS acos() functie

Referentie:CSS asin() functie

Referentie:CSS atan() functie

Referentie:CSS atan2() functie

Referentie:CSS calc() functie

Referentie:CSS cos() functie

Referentie:CSS exp() functie

Referentie:CSS hypot() functie

Referentie:CSS log() functie

Referentie:CSS mod() functie

Referentie:CSS sin() functie

Referentie:CSS tan() functie