aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/list-style-image/index.html
blob: e1f682fc74444f44687f6575875218dfab5c646c (plain)
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
112
113
114
115
---
title: list-style-image
slug: Web/CSS/list-style-image
tags:
  - CSS
  - CSS プロパティ
  - CSS リスト
  - Reference
  - list-style
  - list-style-image
translation_of: Web/CSS/list-style-image
---
<div>{{CSSRef}}</div>

<p><a href="/ja/docs/Web/CSS">CSS</a><strong><code>list-style-image</code></strong> プロパティは、リスト項目のマーカーとして使われる画像を設定します。</p>

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

<div>{{EmbedInteractiveExample("pages/css/list-style-image.html")}}</div>

<div class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</div>

<div class="note">
<p><strong>注:</strong> このプロパティはリスト項目、つまり、 <code>{{cssxref("display")}}: list-item;</code> が指定された要素に対して適用されます。<a href="https://www.w3.org/TR/html5/rendering.html#lists">既定では</a>{{HTMLElement("li")}} 要素を含みます。このプロパティは継承されるので、親要素 (通常は {{HTMLElement("ol")}}{{HTMLElement("ul")}}) に設定することで、すべてのリスト項目に適用することができます。</p>
</div>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="brush:css no-line-numbers notranslate">/* キーワード値 */
list-style-image: none;

/* &lt;url&gt; 値 */
list-style-image: url('starsolid.gif');

/* グローバル値 */
list-style-image: inherit;
list-style-image: initial;
list-style-image: unset;
</pre>

<h3 id="Values" name="Values"></h3>

<dl>
 <dt>{{cssxref("&lt;url&gt;")}}</dt>
 <dd>マーカーとして使う画像の場所です。</dd>
 <dt><code>none</code></dt>
 <dd>画像をマーカーとして使用しないことを指定します。この値が設定された場合、代わりに {{ Cssxref("list-style-type") }} で定義されたマーカーが使われます。</dd>
</dl>

<h2 id="Formal_definition" name="Formal_definition">公式定義</h2>

<p>{{cssinfo}}</p>

<h2 id="Formal_syntax" name="Formal_syntax">形式文法</h2>

<pre class="syntaxbox notranslate">{{csssyntax}}</pre>

<h2 id="Examples" name="Examples"></h2>

<h3 id="Setting_list_item_images" name="Setting_list_item_images">リスト項目の画像の設定</h3>

<h4 id="HTML">HTML</h4>

<pre class="brush: html notranslate">&lt;ul&gt;
  &lt;li&gt;Item 1&lt;/li&gt;
  &lt;li&gt;Item 2&lt;/li&gt;
&lt;/ul&gt;
</pre>

<h4 id="CSS">CSS</h4>

<pre class="brush: css notranslate">ul {
  list-style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif");
}</pre>

<h4 id="Result" name="Result">結果</h4>

<p>{{ EmbedLiveSample('Setting_list_item_images') }}</p>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
   <th scope="col">状態</th>
   <th scope="col">備考</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('CSS3 Lists', '#propdef-list-style-image', 'list-style-image') }}</td>
   <td>{{ Spec2('CSS3 Lists') }}</td>
   <td>すべての {{cssxref("&lt;image&gt;")}} データ型をサポートするように拡張</td>
  </tr>
  <tr>
   <td>{{ SpecName('CSS2.1', 'generate.html#propdef-list-style-image', 'list-style-image') }}</td>
   <td>{{ Spec2('CSS2.1') }}</td>
   <td>初回定義</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>

<p>{{Compat("css.properties.list-style-image")}}</p>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li>{{Cssxref("list-style")}}, {{Cssxref("list-style-type")}}, {{Cssxref("list-style-position")}}</li>
 <li>{{cssxref("url()", "url()")}} 関数</li>
</ul>