CSS - min-width
概要
属性名 | min-width |
---|---|
値 | <length> | <percentage> | none | min-content | max-content | fit-content |
初期値 | 0 |
適用可能要素 | すべての要素 |
継承 | 継承しない |
メディア | visual |
サポート |
https://caniuse.com/mdn-css_properties_min-width https://caniuse.com/intrinsic-width |
説明
最小の横幅を指定します。
値 | 説明 |
---|---|
<length> | 横幅を 10px 1.5em などの長さの単位で指定します。 |
min-content | コンテンツ中の最も長い単語の長さとなります。 |
max-content | コンテンツ中の文章が改行されない場合の長さとなります。 |
fit-content | コンテンツ中の文章が改行されない場合の長さとなります。ただし親要素の横幅を超えることはありません。 |
使用例
HTML
<table> <tr> <td style="min-width:200px; border:1px solid #999999"> ああああ </td> </tr> </table> <table> <tr> <td style="min-width:200px; border:1px solid #999999"> ああああああああああ </td> </tr> </table> <table> <tr> <td style="min-width:200px; border:1px solid #999999"> ああああああああああああああああああああ </td> </tr> </table>
表示
ああああ |
ああああああああああ |
ああああああああああああああああああああ |
関連項目
width, height, min-width, min-height, max-width, max-heightリンク
- http://www.w3.org/TR/CSS2/visudet.html#min-max-widths
- http://www.w3.org/TR/css3-box/#min-max
- http://www.d-toybox.com/spec/CSS3/box/index.html#the-min-width
- https://developer.mozilla.org/ja/docs/Web/CSS/min-width
- http://caniuse.com/#feat=minmaxwh
Copyright (C) 1997-2023 杜甫々
初版:1997年7月27日、最終更新:2023年5月7日
https://www.tohoho-web.com/css/prop/min-width.htm