-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
73 lines (51 loc) · 1.85 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
---
title: "::marker"
slug: Web/CSS/::marker
page-type: css-pseudo-element
browser-compat: css.selectors.marker
---
{{CSSRef}}
The **`::marker`** [CSS](/en-US/docs/Web/CSS) [pseudo-element](/en-US/docs/Web/CSS/Pseudo-elements) selects the marker box of a list item, which typically contains a bullet or number. It works on any element or pseudo-element set to [`display: list-item`](/en-US/docs/Web/CSS/display), such as the {{HTMLElement("li")}} and {{HTMLElement("summary")}} elements.
{{EmbedInteractiveExample("pages/tabbed/pseudo-element-marker.html", "tabbed-shorter")}}
## Allowable properties
The `::marker` pseudo-element supports a limited number of CSS properties, including:
- All [font properties](/en-US/docs/Web/CSS/CSS_fonts)
- The {{CSSxRef("white-space")}} property
- {{CSSxRef("color")}}
- {{CSSxRef("text-combine-upright")}}, {{CSSxRef("unicode-bidi")}}, and {{CSSxRef("direction")}} properties
- The {{CSSxRef("content")}} property
- All [animation](/en-US/docs/Web/CSS/CSS_animations#properties) and [transition](/en-US/docs/Web/CSS/CSS_transitions#properties) properties
> **Note:** The specification states that additional CSS properties may be supported in the future.
## Syntax
```css
::marker {
/* ... */
}
```
## Examples
### HTML
```html
<ul>
<li>Peaches</li>
<li>Apples</li>
<li>Plums</li>
</ul>
```
### CSS
```css
ul li::marker {
color: red;
font-size: 1.5em;
}
```
### Result
{{EmbedLiveSample('Examples')}}
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- HTML elements that have marker boxes by default: {{HTMLElement("ol")}}, {{HTMLElement("li")}}, {{HTMLElement("summary")}}
- [CSS generated content](/en-US/docs/Web/CSS/CSS_generated_content) module
- [CSS lists and counters](/en-US/docs/Web/CSS/CSS_lists) module
- [CSS counter styles](/en-US/docs/Web/CSS/CSS_counter_styles) module