使用 CSS 设置框的最大高度

原创
ithorizon 6个月前 (10-19) 阅读数 49 #CSS

max-height属性用于设置一个盒子的最大高度。max-height属性的值可以是一个数字、一个长度或一个百分比。

示例

<html>
   <head>
   </head>
   <body>
      <p style = "width:400px; max-height:10px; border:2px solid green; padding:10px; margin:15px;">
         This paragraph is 400px wide and max height is 10px
         This paragraph is 400px wide and max height is 10px
         This paragraph is 400px wide and max height is 10px
         This paragraph is 400px wide and max height is 10px
      </p>
      <br>
      <br>
      <br>
      <img alt = "logo" src = "/css/images/logo.png" width = "210" height = "100" />
   </body>
</html>

以上就是使用 CSS 设置框的最大高度的详细内容,更多请关注IT视界其它相关文章!



热门