ホームページ  >  記事  >  ウェブフロントエンド  >  CSSを使用してボックスの最大高さを設定する

CSSを使用してボックスの最大高さを設定する

WBOY
WBOY転載
2023-09-03 21:05:031363ブラウズ

使用 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を使用してボックスの最大高さを設定するの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

声明:
この記事はtutorialspoint.comで複製されています。侵害がある場合は、admin@php.cn までご連絡ください。