From 523f17272ddf4f565504e142fbbf1f98d8fcb94e Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Sun, 7 Nov 2021 21:38:47 +0900 Subject: CSS Lists のプロパティを更新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 2021/11/06 時点の英語版に同期 --- files/ja/web/css/list-style-image/index.md | 142 +++++++++++----------- files/ja/web/css/list-style-position/index.md | 166 ++++++++++++-------------- files/ja/web/css/list-style-type/index.md | 10 +- files/ja/web/css/list-style/index.md | 5 +- 4 files changed, 155 insertions(+), 168 deletions(-) (limited to 'files/ja/web/css') diff --git a/files/ja/web/css/list-style-image/index.md b/files/ja/web/css/list-style-image/index.md index cf725c5287..edf758665c 100644 --- a/files/ja/web/css/list-style-image/index.md +++ b/files/ja/web/css/list-style-image/index.md @@ -5,109 +5,113 @@ tags: - CSS - CSS プロパティ - CSS リスト - - Reference - - list-style - - list-style-image + - リファレンス + - recipe:css-property +browser-compat: css.properties.list-style-image translation_of: Web/CSS/list-style-image --- -
{{CSSRef}}
+{{CSSRef}} -

CSSlist-style-image プロパティは、リスト項目のマーカーとして使われる画像を設定します。

+**`list-style-image`** は [CSS](/ja/docs/Web/CSS) のプロパティで、リスト項目のマーカーとして使われる画像を設定します。 -

ふつうは一括指定の {{cssxref("list-style")}} を使うほうが便利です。

+ふつうは一括指定の {{cssxref("list-style")}} を使ったほうが便利です。 -
{{EmbedInteractiveExample("pages/css/list-style-image.html")}}
+{{EmbedInteractiveExample("pages/css/list-style-image.html")}} - +> **Note:** このプロパティはリスト項目、つまり、`{{cssxref("display")}}: list-item;` が指定された要素に対して適用されます。[既定では](https://www.w3.org/TR/html5/rendering.html#lists)、 {{HTMLElement("li")}} 要素を含みます。このプロパティは継承されるので、親要素 (通常は {{HTMLElement("ol")}} や {{HTMLElement("ul")}}) に設定することで、すべてのリスト項目に適用することができます。 -
-

注: このプロパティはリスト項目、つまり、 {{cssxref("display")}}: list-item; が指定された要素に対して適用されます。既定では、 {{HTMLElement("li")}} 要素を含みます。このプロパティは継承されるので、親要素 (通常は {{HTMLElement("ol")}} や {{HTMLElement("ul")}}) に設定することで、すべてのリスト項目に適用することができます。

-
+## 構文 -

構文

- -
/* キーワード値 */
+```css
+/* キーワード値 */
 list-style-image: none;
 
-/* <url> 値 */
+/*   値 */
 list-style-image: url('starsolid.gif');
 
+/* 有効な画像値 */
+list-style-image: linear-gradient(to left bottom, red, blue);
+
 /* グローバル値 */
 list-style-image: inherit;
 list-style-image: initial;
+list-style-image: revert;
 list-style-image: unset;
-
+``` -

+### 値 -
-
{{cssxref("<url>")}}
-
マーカーとして使う画像の場所です。
-
none
-
画像をマーカーとして使用しないことを指定します。この値が設定された場合、代わりに {{ Cssxref("list-style-type") }} で定義されたマーカーが使われます。
-
+- {{cssxref("<image>")}} + - : マーカーとして使う画像の場所です。 +- `none` + - : 画像をマーカーとして使用しないことを指定します。この値が設定された場合、代わりに {{ Cssxref("list-style-type") }} で定義されたマーカーが使われます。 -

公式定義

+## 公式定義 -

{{cssinfo}}

+{{cssinfo}} -

形式文法

+## 形式文法 {{csssyntax}} -

+## 例 -

リスト項目の画像の設定

+

url 値の使用

-

HTML

+#### HTML -
<ul>
-  <li>Item 1</li>
-  <li>Item 2</li>
-</ul>
-
+```html + +``` -

CSS

+#### CSS -
ul {
-  list-style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif");
-}
+```css +ul { + list-style-image: url("starsolid.gif"); +} +``` -

結果

+#### 結果 -

{{ EmbedLiveSample('Setting_list_item_images') }}

+{{ EmbedLiveSample('Using_a_url_value') }} -

仕様書

+

グラデーションの使用

- - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{ SpecName('CSS3 Lists', '#propdef-list-style-image', 'list-style-image') }}{{ Spec2('CSS3 Lists') }}すべての {{cssxref("<image>")}} データ型をサポートするように拡張
{{ SpecName('CSS2.1', 'generate.html#propdef-list-style-image', 'list-style-image') }}{{ Spec2('CSS2.1') }}初回定義
+#### HTML -

ブラウザーの互換性

+```html + +``` -

{{Compat("css.properties.list-style-image")}}

+#### CSS -

関連情報

+```css +ul { + font-size: 200%; + list-style-image: linear-gradient(to left bottom, red, blue); +} +``` - +#### 結果 + +{{ EmbedLiveSample('Using_a_gradient') }} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- {{Cssxref("list-style")}}, {{Cssxref("list-style-type")}}, {{Cssxref("list-style-position")}} +- {{cssxref("url()", "url()")}} 関数 diff --git a/files/ja/web/css/list-style-position/index.md b/files/ja/web/css/list-style-position/index.md index 736b5876f4..6e40a21dfb 100644 --- a/files/ja/web/css/list-style-position/index.md +++ b/files/ja/web/css/list-style-position/index.md @@ -5,78 +5,85 @@ tags: - CSS - CSS プロパティ - CSS リスト - - Reference - - list-style - - list-style-position + - リファレンス + - recipe:css-property +browser-compat: css.properties.list-style-position translation_of: Web/CSS/list-style-position --- -
{{CSSRef}}
+{{CSSRef}} -

CSSlist-style-position プロパティは、リストアイテムに対する {{cssxref("::marker")}} の位置を指定します。

+**`list-style-position`** は [CSS](/ja/docs/Web/CSS) のプロパティで、リスト項目に対する {{cssxref("::marker")}} の位置を指定します。 -
{{EmbedInteractiveExample("pages/css/list-style-position.html")}}
+{{EmbedInteractiveExample("pages/css/list-style-position.html")}} - +多くの場合、一括指定の {{cssxref("list-style")}} を使ったほうが便利です。 -

多くの場合、一括指定の {{cssxref("list-style")}} を使うほうが便利です。

+> **Note:** このプロパティはリスト項目に対して適用されます。つまり、 `{{cssxref("display")}}: list-item;` が指定された要素です。[既定では](https://www.w3.org/TR/html5/rendering.html#lists)、 {{HTMLElement("li")}} 要素が該当します。このプロパティは継承されるので、親要素 (通常は {{HTMLElement("ol")}} や {{HTMLElement("ul")}}) に設定することで、すべてのリスト項目に適用することができます。 -

メモ: このプロパティはリストアイテムに対して適用されます。つまり、 {{cssxref("display")}}: list-item; が指定された要素です。既定では、 {{HTMLElement("li")}} 要素を含みます。このプロパティは継承されるので、親要素 (通常は {{HTMLElement("ol")}} や {{HTMLElement("ul")}}) に設定することで、すべてのリストアイテムに適用することができます。

+なお、 `list-style-position: inside` を指定したリスト要素の中で最初にブロック要素が配置された場合、その動作はブラウザーによって異なります。 Chrome と Safari では、この要素はマーカーボックスと同じ行に配置されますが、 Firefox、 Internet Explorer、 Opera では次の行に配置されます。 詳細については {{bug(36854)}} をご覧ください。 -

メモ: list-style-position: inside を指定したリスト要素の中で最初にブロック要素が配置された場合、その動作はブラウザーによって異なります。 Chrome と Safari では、この要素はマーカーボックスと同じ行に配置されますが、 Firefox、 Internet Explorer、 Opera では次の行に配置されます。 詳細については {{bug(36854)}} をご覧ください。

+## 構文 -

構文

- -
/* キーワード値 */
+```css
+/* キーワード値 */
 list-style-position: inside;
 list-style-position: outside;
 
 /* グローバル値 */
 list-style-position: inherit;
 list-style-position: initial;
+list-style-position: revert;
 list-style-position: unset;
-
+``` + +`list-style-position` プロパティには、下記の値の中の一つが指定されます。 + +### 値 -

list-style-position プロパティには、下記の値の中の一つが指定されます。

+- `inside` + - : {{cssxref("::marker")}} はリスト項目の最初の要素として配置されます。 +- `outside` + - : {{cssxref("::marker")}} は主要ブロックボックスの外に配置されます。 -

+## 公式定義 -
-
inside
-
{{cssxref("::marker")}} はリストアイテムの最初の要素として配置されます。
-
outside
-
{{cssxref("::marker")}} は主要ブロックボックスの外に配置されます。
-
+{{cssinfo}} -

形式文法

+## 形式文法 {{csssyntax}} -

- -

HTML

- -
<ul class="inside">List 1
-  <li>List Item 1-1</li>
-  <li>List Item 1-2</li>
-  <li>List Item 1-3</li>
-  <li>List Item 1-4</li>
-</ul>
-<ul class="outside">List 2
-  <li>List Item 2-1</li>
-  <li>List Item 2-2</li>
-  <li>List Item 2-3</li>
-  <li>List Item 2-4</li>
-</ul>
-<ul class="inside-img">List 3
-  <li>List Item 3-1</li>
-  <li>List Item 3-2</li>
-  <li>List Item 3-3</li>
-  <li>List Item 3-4</li>
-</ul>
- -

CSS

- -
.inside {
+## 例
+
+

リスト項目の位置の設定

+ +#### HTML + +```html + + + +``` + +#### CSS + +```css +.inside { list-style-position: inside; list-style-type: square; } @@ -88,45 +95,22 @@ list-style-position: unset; .inside-img { list-style-position: inside; - list-style-image: url("https://mdn.mozillademos.org/files/11979/starsolid.gif"); -}
- -

結果

- -

{{EmbedLiveSample("Examples", 200, 420)}}

- -

仕様書

- - - - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('CSS3 Lists', '#list-style-position-property', 'list-style-position')}}{{Spec2('CSS3 Lists')}}変更なし
{{SpecName('CSS2.1', 'generate.html#propdef-list-style-position', 'list-style-position')}}{{Spec2('CSS2.1')}}初回定義
- -

{{cssinfo}}

- -

ブラウザーの対応

- -

{{Compat("css.properties.list-style-position")}}

- -

関連情報

- - + list-style-image: url("starsolid.gif"); +} +``` + +#### 結果 + +{{EmbedLiveSample("Setting_list_item_position", 200, 420)}} + +## 仕様書 + +{{Specifications}} + +## ブラウザーの互換性 + +{{Compat}} + +## 関連情報 + +- {{Cssxref("list-style")}}, {{Cssxref("list-style-type")}}, {{Cssxref("list-style-image")}} diff --git a/files/ja/web/css/list-style-type/index.md b/files/ja/web/css/list-style-type/index.md index 518ab2a49c..7f32b278b8 100644 --- a/files/ja/web/css/list-style-type/index.md +++ b/files/ja/web/css/list-style-type/index.md @@ -5,20 +5,20 @@ tags: - CSS - CSS プロパティ - CSS リスト - - Reference + - リファレンス - recipe:css-property browser-compat: css.properties.list-style-type translation_of: Web/CSS/list-style-type --- {{CSSRef}} -**`list-style-type`** は [CSS](/ja/docs/Web/CSS) のプロパティで、リスト項目要素のマーカーを設定します (円、文字、独自のカウンタースタイルなど)。

+**`list-style-type`** は [CSS](/ja/docs/Web/CSS) のプロパティで、リスト項目要素のマーカーを設定します (円、文字、独自のカウンタースタイルなど)。 {{EmbedInteractiveExample("pages/css/list-style-type.html")}} マーカーの[色](/ja/docs/Web/CSS/color_value)は、適用先の要素における色の計算値と同じになります。 -わずかな要素 ({{HTMLElement("li")}} と {{HTMLElement("summary")}}) だけが既定で `display: list-item` の値を持っています。しかし、 `list-style-type` プロパティは {{cssxref("display")}} の値が `list-item` に設定されているあらゆる要素に適用することができます。さらに、このプロパティは継承されるので、親要素 (普通は {{HTMLElement("ol")}} または {{HTMLElement("ul")}}) に設定することですべてのリスト項目に適用することができます。

+わずかな要素 ({{HTMLElement("li")}} と {{HTMLElement("summary")}}) だけが既定で `display: list-item` の値を持っています。しかし、 `list-style-type` プロパティは {{cssxref("display")}} の値が `list-item` に設定されているあらゆる要素に適用することができます。さらに、このプロパティは継承されるので、親要素 (普通は {{HTMLElement("ol")}} または {{HTMLElement("ul")}}) に設定することですべてのリスト項目に適用することができます。 ## 構文 @@ -140,7 +140,7 @@ list-style-type: unset; - : 韓国語の漢数字です。 - `lao`, `-moz-lao` - : ラオス語の数値表記です。 -- `lower-armenian` {{experimental_inline}} +- `lower-armenian` {{experimental_inline}}\* - : アルメニア語の小文字の数値表記です。 - `malayalam`, `-moz-malayalam` - : マラヤーラム語の数値表記です。 @@ -168,7 +168,7 @@ list-style-type: unset; - : 公的な繁体字中国語の数値表記です。 - `trad-chinese-informal` {{experimental_inline}} - : 日常的な繁体字中国語の数値表記です。 -- `upper-armenian` {{experimental_inline}}` +- `upper-armenian` {{experimental_inline}}\* - : 伝統的なアルメニア語の大文字の数値表記です。 - `disclosure-open` {{experimental_inline}} - : {{HTMLElement("details")}} などの展開ウィジェットを開いていることを示す記号 diff --git a/files/ja/web/css/list-style/index.md b/files/ja/web/css/list-style/index.md index 1cbd6d7f60..af0e998fc1 100644 --- a/files/ja/web/css/list-style/index.md +++ b/files/ja/web/css/list-style/index.md @@ -5,7 +5,7 @@ tags: - CSS - CSS Lists - CSS プロパティ - - Reference + - リファレンス - recipe:css-shorthand-property browser-compat: css.properties.list-style translation_of: Web/CSS/list-style @@ -17,7 +17,6 @@ translation_of: Web/CSS/list-style {{EmbedInteractiveExample("pages/css/list-style.html")}} > **Note:** このプロパティはリスト項目、すなわち `{{cssxref("display")}}: list-item;` の要素に適用されます。[既定では](https://www.w3.org/TR/html5/rendering.html#lists) {{HTMLElement("li")}} 要素が含まれます。このプロパティは継承されるので、親要素 (ふつうは {{HTMLElement("ol")}} または {{HTMLElement("ul")}}) に設定すれば、同じリストスタイルを内部のすべての項目に適用できます。 - ## 構成要素のプロパティ @@ -74,7 +73,7 @@ list-style: unset; この問題に対処する最も簡単な方法は、明示的に `role="list"` をマークアップ内の `