<!DOCTYPE html>
<html>
<head>
<style>
div.a {
width: calc(50px * sqrt(16));
height: calc(50px * sqrt(9));
background-color: salmon;
margin-bottom: 25px;
}
div.b {
width: calc(20px * sqrt(16));
height: calc(20px * sqrt(9));
background-color: green;
margin-bottom: 25px;
}
div.c {
width: calc(60px * sqrt(16));
height: calc(60px * sqrt(9));
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>