x
 
<!DOCTYPE html>
<html>
<head>
<style>
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;
}
</style>
</head>
<body>
<h1>sqrt() 函数</h1>
 
<p>在这里,sqrt() 函数被用在 calc() 函数中,以设置三个 div 元素的宽度和高度。</p>
<div class="a"></div>
<div class="b"></div>
<div class="c"></div>
</body>
</html>