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/width/index.html | 201 -------------------------------------- files/ja/web/css/width/index.md | 201 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 files/ja/web/css/width/index.html create mode 100644 files/ja/web/css/width/index.md (limited to 'files/ja/web/css/width') diff --git a/files/ja/web/css/width/index.html b/files/ja/web/css/width/index.html deleted file mode 100644 index 322e08849b..0000000000 --- a/files/ja/web/css/width/index.html +++ /dev/null @@ -1,201 +0,0 @@ ---- -title: width -slug: Web/CSS/width -tags: - - CSS - - CSS Property - - Layout - - Reference - - dimensions - - recipe:css-property - - size - - width -browser-compat: css.properties.width -translation_of: Web/CSS/width ---- -

{{CSSRef}}

- -

width は CSS のプロパティで、要素の幅を設定します。既定では、このプロパティはコンテンツ領域の幅を設定しますが、 {{cssxref("box-sizing")}} を border-box に設定すると、境界領域の幅を設定します。

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

{{cssxref("min-width")}} および {{cssxref("max-width")}} プロパティは width を上書きします。

- -

構文

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

- -
-
{{cssxref("<length>")}}
-
絶対的な値で幅を定義します。
-
{{cssxref("<percentage>")}}
-
親となる包含ブロックの幅に対するパーセント値で定義します。
-
auto
-
指定された要素の幅をブラウザーが計算して決めます。
-
max-content
-
望ましい固有の幅です。
-
min-content
-
最小の固有の幅です。
-
fit-content({{cssxref("<length-percentage>")}})
-
利用可能な空間に対して fit-content 式を使用し、指定された引数に置き換えられます。すなわち min(max-content, max(min-content, <length-percentage>)) です。
-
- -

アクセシビリティの考慮

- -

ページを拡大してテキストサイズを大きくしたときに、 width を設定した要素が切り捨てられたり、他のコンテンツが見えなくなったりしないようにしてください。

- - - -

公式定義

- -

{{CSSInfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

既定の幅

- -
p.goldie {
-  background: gold;
-}
- -
<p class="goldie">The Mozilla community produces a lot of great software.</p>
- -

{{EmbedLiveSample('Default_width', '500px', '64px')}}

- -

ピクセル数と em 単位

- -
.px_length {
-  width: 200px;
-  background-color: red;
-  color: white;
-  border: 1px solid black;
-}
-
-.em_length {
-  width: 20em;
-  background-color: white;
-  color: red;
-  border: 1px solid black;
-}
-
- -
<div class="px_length">Width measured in px</div>
-<div class="em_length">Width measured in em</div>
- -

{{EmbedLiveSample('Pixels_and_ems', '500px', '64px')}}

- -

パーセント値

- -
.percent {
-  width: 20%;
-  background-color: silver;
-  border: 1px solid red;
-}
- -
<div class="percent">Width in percentage</div>
- -

{{EmbedLiveSample('Percentage', '500px', '64px')}}

- -

max-content

- -
p.maxgreen {
-  background: lightgreen;
-  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
-  width: -moz-max-content;    /* Firefox/Gecko */
-  width: -webkit-max-content; /* Chrome */
-  width: max-content;
-}
- -
<p class="maxgreen">The Mozilla community produces a lot of great software.</p>
- -

{{EmbedLiveSample('max-content', '500px', '64px')}}

- -

min-content

- -
p.minblue {
-  background: lightblue;
-  width: -moz-min-content;    /* Firefox */
-  width: -webkit-min-content; /* Chrome */
-  width: min-content;
-}
- -
<p class="minblue">The Mozilla community produces a lot of great software.</p>
- -

{{EmbedLiveSample('min-content', '500px', '155px')}}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS4 Sizing', '#width-height-keywords', 'width')}}{{Spec2('CSS4 Sizing')}}
{{SpecName('CSS3 Sizing', '#width-height-keywords', 'width')}}{{Spec2('CSS3 Sizing')}}キーワード max-content, min-content, fit-content を追加
{{SpecName('CSS2.1', 'visudet.html#the-width-property', 'width')}}{{Spec2('CSS2.1')}}適用対象の要素を詳しく記載
{{SpecName('CSS1', '#width', 'width')}}{{Spec2('CSS1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat}}

- -

関連情報

- - diff --git a/files/ja/web/css/width/index.md b/files/ja/web/css/width/index.md new file mode 100644 index 0000000000..322e08849b --- /dev/null +++ b/files/ja/web/css/width/index.md @@ -0,0 +1,201 @@ +--- +title: width +slug: Web/CSS/width +tags: + - CSS + - CSS Property + - Layout + - Reference + - dimensions + - recipe:css-property + - size + - width +browser-compat: css.properties.width +translation_of: Web/CSS/width +--- +

{{CSSRef}}

+ +

width は CSS のプロパティで、要素の幅を設定します。既定では、このプロパティはコンテンツ領域の幅を設定しますが、 {{cssxref("box-sizing")}} を border-box に設定すると、境界領域の幅を設定します。

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

{{cssxref("min-width")}} および {{cssxref("max-width")}} プロパティは width を上書きします。

+ +

構文

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

+ +
+
{{cssxref("<length>")}}
+
絶対的な値で幅を定義します。
+
{{cssxref("<percentage>")}}
+
親となる包含ブロックの幅に対するパーセント値で定義します。
+
auto
+
指定された要素の幅をブラウザーが計算して決めます。
+
max-content
+
望ましい固有の幅です。
+
min-content
+
最小の固有の幅です。
+
fit-content({{cssxref("<length-percentage>")}})
+
利用可能な空間に対して fit-content 式を使用し、指定された引数に置き換えられます。すなわち min(max-content, max(min-content, <length-percentage>)) です。
+
+ +

アクセシビリティの考慮

+ +

ページを拡大してテキストサイズを大きくしたときに、 width を設定した要素が切り捨てられたり、他のコンテンツが見えなくなったりしないようにしてください。

+ + + +

公式定義

+ +

{{CSSInfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

既定の幅

+ +
p.goldie {
+  background: gold;
+}
+ +
<p class="goldie">The Mozilla community produces a lot of great software.</p>
+ +

{{EmbedLiveSample('Default_width', '500px', '64px')}}

+ +

ピクセル数と em 単位

+ +
.px_length {
+  width: 200px;
+  background-color: red;
+  color: white;
+  border: 1px solid black;
+}
+
+.em_length {
+  width: 20em;
+  background-color: white;
+  color: red;
+  border: 1px solid black;
+}
+
+ +
<div class="px_length">Width measured in px</div>
+<div class="em_length">Width measured in em</div>
+ +

{{EmbedLiveSample('Pixels_and_ems', '500px', '64px')}}

+ +

パーセント値

+ +
.percent {
+  width: 20%;
+  background-color: silver;
+  border: 1px solid red;
+}
+ +
<div class="percent">Width in percentage</div>
+ +

{{EmbedLiveSample('Percentage', '500px', '64px')}}

+ +

max-content

+ +
p.maxgreen {
+  background: lightgreen;
+  width: intrinsic;           /* Safari/WebKit uses a non-standard name */
+  width: -moz-max-content;    /* Firefox/Gecko */
+  width: -webkit-max-content; /* Chrome */
+  width: max-content;
+}
+ +
<p class="maxgreen">The Mozilla community produces a lot of great software.</p>
+ +

{{EmbedLiveSample('max-content', '500px', '64px')}}

+ +

min-content

+ +
p.minblue {
+  background: lightblue;
+  width: -moz-min-content;    /* Firefox */
+  width: -webkit-min-content; /* Chrome */
+  width: min-content;
+}
+ +
<p class="minblue">The Mozilla community produces a lot of great software.</p>
+ +

{{EmbedLiveSample('min-content', '500px', '155px')}}

+ +

仕様書

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('CSS4 Sizing', '#width-height-keywords', 'width')}}{{Spec2('CSS4 Sizing')}}
{{SpecName('CSS3 Sizing', '#width-height-keywords', 'width')}}{{Spec2('CSS3 Sizing')}}キーワード max-content, min-content, fit-content を追加
{{SpecName('CSS2.1', 'visudet.html#the-width-property', 'width')}}{{Spec2('CSS2.1')}}適用対象の要素を詳しく記載
{{SpecName('CSS1', '#width', 'width')}}{{Spec2('CSS1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat}}

+ +

関連情報

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