CSSの最小幅プロパティ
例
<span>要素の最小幅を500ピクセルに設定します。
span.ex1
{
min-width: 500px;
}
定義と使用法
プロパティは、要素のmin-width
最小幅を定義します。
コンテンツが最小幅よりも小さい場合は、最小幅が適用されます。
コンテンツが最小幅よりも大きい場合、
min-width
プロパティは効果がありません。
注:これにより、
widthプロパティの値が。より小さくなる
のを防ぎますmin-width
。
デフォルト値: | 0 |
---|---|
遺伝性の: | いいえ |
アニメート可能: | はい、個々のプロパティを参照してください。アニメート可能について読む |
バージョン: | CSS2 |
JavaScript構文: | オブジェクト.style.minWidth = "400px" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
min-width | 1.0 | 7.0 | 1.0 | 2.0.2 | 4.0 |
CSS構文
min-width: length|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
length | Default value is 0. Defines the minimum width in px, cm, etc. Read about length units | |
% | Defines the minimum width in percent of the containing block | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSSの高さと幅
CSSリファレンス:max-widthプロパティ
HTML DOMリファレンス: minWidthプロパティ