function

hypot() — CSS reference

Return the Euclidean norm of compatible quantities: the square root of the sum of their squares. Unlike sqrt(), hypot() accepts compatible dimensions and returns a value of their combined type. Negative input components do not make the result negative.

Formal Syntax & Structure

css syntaxcss
hypot(<calc-sum>#)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS math lab</title><style>body {margin:0} .sample {height:12px;background:#006050}.parent {width:300px} .sample {width:40px;margin-bottom:4px} #a {width: hypot(30px, 40px)} #b {width: hypot(-60px, 80px)}</style><body><div class="parent"><div id="a" class="sample"></div><div id="b" class="sample"></div></div></body></html>
CSS Reference