代码示例:(标识:css_dim_height)
<!DOCTYPE html>
<html>
<head>
<style>
img.one {
  height: auto;
}

img.two {
  height: 200px;
  width: 200px;
}

div.three {
  height: 300px;
  width: 300px;
  background-color: powderblue;
}
</style>
</head>
<body>

<h1>设置元素的高度和宽度</h1>

<p>原始图像:</p>
<img class="one" src="/static/demo/images/tulip.jpg" width="300" height="300"><br>

<p>尺寸调整后的图像 (200x200 像素):</p>
<img class="two" src="/static/demo/images/tulip.jpg" width="300" height="300"><br>

<p>这个 div 的高度和宽度是 300px:</p>
<div class="three"></div>

</body>
</html>
运行结果: