使用CSS设置元素的最小高度和最大高度

要使用CSS设置元素的最小高度和最大高度,您可以尝试运行以下代码-

示例

<!DOCTYPE html>

<html>

   <head>

      <style>

         div {

            max-height: 550px;

            min-height: 450px;

            background-color: red;

         }

      </style>

   </head>

   <body>

      <p> Below is a div with maximum and minimum height. Resize the web browser to see the effect.</p>

      <div>This is demo text. This is demo text. This is demo text.

         This is demo text. This is demo text. This is demo text.

         This is demo text. This is demo text. This is demo text.

      </div>

   </body>

</html>

以上是 使用CSS设置元素的最小高度和最大高度 的全部内容, 来源链接: utcz.com/z/322032.html

回到顶部