-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
111 lines (74 loc) · 2.3 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
title: list-style-image
slug: Web/CSS/list-style-image
---
{{CSSRef}}
**`list-style-image`** は [CSS](/ja/docs/Web/CSS) のプロパティで、リスト項目のマーカーとして使われる画像を設定します。
ふつうは一括指定の {{cssxref("list-style")}} を使ったほうが便利です。
{{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")}}) に設定することで、すべてのリスト項目に適用することができます。
## 構文
```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("<image>")}}
- : マーカーとして使う画像の場所です。
- `none`
- : 画像をマーカーとして使用しないことを指定します。この値が設定された場合、代わりに {{ Cssxref("list-style-type") }} で定義されたマーカーが使われます。
## 公式定義
{{cssinfo}}
## 形式文法
{{csssyntax}}
## 例
### url 値の使用
#### HTML
```html
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
```
#### CSS
```css
ul {
list-style-image: url("starsolid.gif");
}
```
#### 結果
{{ EmbedLiveSample('url 値の使用') }}
### グラデーションの使用
#### HTML
```html
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
```
#### CSS
```css
ul {
font-size: 200%;
list-style-image: linear-gradient(to left bottom, red, blue);
}
```
#### 結果
{{ EmbedLiveSample('グラデーションの使用') }}
## 仕様書
{{Specifications}}
## ブラウザーの互換性
{{Compat}}
## 関連情報
- {{Cssxref("list-style")}}, {{Cssxref("list-style-type")}}, {{Cssxref("list-style-position")}}
- {{cssxref("url()", "url()")}} 関数