From 7d2c0d3e42d5bc62163a415da456c07c39bd63b6 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 16 Nov 2021 00:30:59 +0900 Subject: CSS Sizing に関するプロパティの変換準備 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/css/max-width/index.html | 140 ---------------------------------- files/ja/web/css/max-width/index.md | 140 ++++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+), 140 deletions(-) delete mode 100644 files/ja/web/css/max-width/index.html create mode 100644 files/ja/web/css/max-width/index.md (limited to 'files/ja/web/css/max-width') diff --git a/files/ja/web/css/max-width/index.html b/files/ja/web/css/max-width/index.html deleted file mode 100644 index 89feb27342..0000000000 --- a/files/ja/web/css/max-width/index.html +++ /dev/null @@ -1,140 +0,0 @@ ---- -title: max-width -slug: Web/CSS/max-width -tags: - - CSS - - CSS Property - - CSS プロパティ - - Reference -translation_of: Web/CSS/max-width ---- -
{{CSSRef}}
- -

max-widthCSS のプロパティで、要素の最大幅を設定します。これは {{Cssxref("width")}} プロパティの使用値が、 max-width で指定した値を上回ることを防ぎます。

- -
{{EmbedInteractiveExample("pages/css/max-width.html")}}
- - - -

max-width は {{cssxref("width")}} を上書きしますが、 {{cssxref("min-width")}} は max-width を上書きします。

- -

構文

- -
/* <length> 値 */
-max-width: 3.5em;
-
-/* <percentage> 値 */
-max-width: 75%;
-
-/* キーワード値 */
-max-width: none;
-max-width: max-content;
-max-width: min-content;
-max-width: fit-content(20em);
-
-/* グローバル値 */
-max-width: inherit;
-max-width: initial;
-max-width: unset;
-
- -

- -
-
{{cssxref("<length>")}}
-
max-width を絶対的な値で定義します。
-
{{cssxref("<percentage>")}}
-
max-width を包含ブロックの幅に対するパーセント値で定義します。
-
auto
-
ブラウザーは指定された要素の max-width を計算して選択します。
-
none
-
ボックスの寸法を制限しません。
-
max-content
-
内容物が推奨する max-width です。
-
min-content
-
内容物の最小の max-width です。
-
fit-content({{cssxref("<length-percentage>")}})
-
利用可能な空白を指定された引数で置き換えた fit-content 式を使用します。すなわち、 min(max-content, max(min-content, 引数)) です。
-
- -

形式文法

- -{{csssyntax}} - -

- -

この例では、 "child" の幅が150ピクセルか "parent" の幅のどちらか小さい方になります。

- -
-
<div id="parent">
-  <div id="child">
-    Fusce pulvinar vestibulum eros, sed luctus ex lobortis quis.
-  </div>
-</div>
-
- -
#parent {
-  background: lightblue;
-  width: 300px;
-}
-
-#child {
-  background: gold;
-  width: 100%;
-  max-width: 150px;
-}
-
-
- -

{{EmbedLiveSample("basic-max-width-demo", 350, 100)}}

- -

アクセシビリティの考慮事項

- -

ページを拡大縮小して文字サイズを拡大した際に、 max-width を設定した要素が他のコンテンツを切り捨てたり妨げたりしないことを確認してください。

- - - -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS4 Sizing', '#width-height-keywords', 'max-width')}}{{Spec2('CSS4 Sizing')}}
{{SpecName('CSS3 Sizing', '#width-height-keywords', 'max-width')}}{{Spec2('CSS3 Sizing')}}キーワード max-content, min-content, fit-content, fill-available を追加。
{{ SpecName('CSS2.1', 'visudet.html#min-max-widths', 'max-width') }}{{ Spec2('CSS2.1') }}初回定義
- -

{{cssinfo}}

- -

ブラウザーの互換性

- -

{{Compat("css.properties.max-width")}}

- -

関連情報

- - diff --git a/files/ja/web/css/max-width/index.md b/files/ja/web/css/max-width/index.md new file mode 100644 index 0000000000..89feb27342 --- /dev/null +++ b/files/ja/web/css/max-width/index.md @@ -0,0 +1,140 @@ +--- +title: max-width +slug: Web/CSS/max-width +tags: + - CSS + - CSS Property + - CSS プロパティ + - Reference +translation_of: Web/CSS/max-width +--- +
{{CSSRef}}
+ +

max-widthCSS のプロパティで、要素の最大幅を設定します。これは {{Cssxref("width")}} プロパティの使用値が、 max-width で指定した値を上回ることを防ぎます。

+ +
{{EmbedInteractiveExample("pages/css/max-width.html")}}
+ + + +

max-width は {{cssxref("width")}} を上書きしますが、 {{cssxref("min-width")}} は max-width を上書きします。

+ +

構文

+ +
/* <length> 値 */
+max-width: 3.5em;
+
+/* <percentage> 値 */
+max-width: 75%;
+
+/* キーワード値 */
+max-width: none;
+max-width: max-content;
+max-width: min-content;
+max-width: fit-content(20em);
+
+/* グローバル値 */
+max-width: inherit;
+max-width: initial;
+max-width: unset;
+
+ +

+ +
+
{{cssxref("<length>")}}
+
max-width を絶対的な値で定義します。
+
{{cssxref("<percentage>")}}
+
max-width を包含ブロックの幅に対するパーセント値で定義します。
+
auto
+
ブラウザーは指定された要素の max-width を計算して選択します。
+
none
+
ボックスの寸法を制限しません。
+
max-content
+
内容物が推奨する max-width です。
+
min-content
+
内容物の最小の max-width です。
+
fit-content({{cssxref("<length-percentage>")}})
+
利用可能な空白を指定された引数で置き換えた fit-content 式を使用します。すなわち、 min(max-content, max(min-content, 引数)) です。
+
+ +

形式文法

+ +{{csssyntax}} + +

+ +

この例では、 "child" の幅が150ピクセルか "parent" の幅のどちらか小さい方になります。

+ +
+
<div id="parent">
+  <div id="child">
+    Fusce pulvinar vestibulum eros, sed luctus ex lobortis quis.
+  </div>
+</div>
+
+ +
#parent {
+  background: lightblue;
+  width: 300px;
+}
+
+#child {
+  background: gold;
+  width: 100%;
+  max-width: 150px;
+}
+
+
+ +

{{EmbedLiveSample("basic-max-width-demo", 350, 100)}}

+ +

アクセシビリティの考慮事項

+ +

ページを拡大縮小して文字サイズを拡大した際に、 max-width を設定した要素が他のコンテンツを切り捨てたり妨げたりしないことを確認してください。

+ + + +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS4 Sizing', '#width-height-keywords', 'max-width')}}{{Spec2('CSS4 Sizing')}}
{{SpecName('CSS3 Sizing', '#width-height-keywords', 'max-width')}}{{Spec2('CSS3 Sizing')}}キーワード max-content, min-content, fit-content, fill-available を追加。
{{ SpecName('CSS2.1', 'visudet.html#min-max-widths', 'max-width') }}{{ Spec2('CSS2.1') }}初回定義
+ +

{{cssinfo}}

+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.max-width")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf