aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/_doublecolon_marker/index.html
blob: 047033e75fc851a480d481f3aca62804a97d8754 (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
---
title: '::marker'
slug: 'Web/CSS/::marker'
translation_of: 'Web/CSS/::marker'
---
<div>{{CSSRef}}</div>

<p><span class="seoSummary"><strong><code>::marker</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> <a href="/en/CSS/Pseudo-elements">pseudo-element</a>(CSS伪元素) 选中一个list item的marker box,后者通常含有一个项目符号或者数字。</span>它作用在任何设置了<code><a href="/en-US/docs/Web/CSS/display">display: list-item</a></code>的元素或伪元素上,例如{{HTMLElement("li")}}{{HTMLElement("summary")}}</p>

<pre class="brush: css no-line-numbers notranslate">::marker {
  color: blue;
  font-size: 1.2em;
}</pre>

<h2 id="允许的属性值">允许的属性值</h2>

<p><span class="tlid-translation translation" lang="zh-CN"><span title="">在将</span></span><code>::marker</code><span class="tlid-translation translation" lang="zh-CN"><span title="">作为选择器的规则中,只能使用某些CSS属性:</span></span></p>

<ul>
 <li>All <a href="/en-US/docs/Web/CSS/CSS_Fonts">font properties</a>(字体属性)</li>
 <li>{{CSSxRef("color")}}</li>
 <li>{{CSSxRef("text-combine-upright")}}, {{CSSxRef("unicode-bidi")}} and {{CSSxRef("direction")}} properties</li>
 <li>The {{CSSxRef("content")}} property</li>
</ul>

<div class="blockIndicator note">
<p><span class="tlid-translation translation" lang="zh-CN"><span title="">规范指出,将来可能会支持其他CSS属性。</span></span></p>
</div>

<h2 id="语法">语法</h2>

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

<h2 id="示例">示例</h2>

<h3 id="HTML">HTML</h3>

<pre class="brush: html notranslate">&lt;ul&gt;
  &lt;li&gt;Peaches&lt;/li&gt;
  &lt;li&gt;Apples&lt;/li&gt;
  &lt;li&gt;Plums&lt;/li&gt;
&lt;/ul&gt;</pre>

<h3 id="CSS">CSS</h3>

<pre class="brush: css notranslate">ul li::marker {
  color: red;
  font-size: 1.5em;
}</pre>

<h3 id="Result">Result</h3>

<p>{{EmbedLiveSample('示例')}}</p>

<h2 id="标准">标准</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS4 Pseudo-Elements', '#marker-pseudo', '::marker')}}</td>
   <td>{{Spec2('CSS4 Pseudo-Elements')}}</td>
   <td>No significant change.</td>
  </tr>
  <tr>
   <td>{{SpecName('CSS3 Lists', '#marker-pseudo', '::marker')}}</td>
   <td>{{Spec2('CSS3 Lists')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<div>


<p>{{Compat("css.selectors.marker")}}</p>
</div>

<h2 id="参见">参见</h2>

<ul>
 <li>默认拥有marker boxes的HTML元素:{{HTMLElement("ol")}}{{HTMLElement("li")}}{{HTMLElement("summary")}}</li>
</ul>