Css-min-height

提供:Dev Guides
移動先:案内検索

CSS-最小高さ

説明

_min-height_プロパティは、要素の高さに下限を設定するために使用されます。

可能な値

  • length -任意の長さの単位。 要素は、この距離より低い高さの値を持つことはできません。
  • percentage -要素の高さを、少なくとも包含ブロックの高さのこのパーセンテージに制限します。

に適用されます

非置換インライン要素と表要素を除くすべてのHTML要素。

DOM構文

object.style.minHeight = "50px"

ここに例があります-

<html>
   <head>
   </head>

   <body>
      <p style = "width:400px; min-height:200px; border:1px solid red; padding:5px; margin:10px;">
         This paragraph is 400px wide and min height is 200px
         This paragraph is 400px wide and min height is 200px
         This paragraph is 400px wide and min height is 200px
         This paragraph is 400px wide and min height is 200px
      </p>

      <img alt = "logo" src = "/css/images/logo.png" width = "95" height = "84"/>
   </body>
</html>

これにより、次の結果が生成されます–