::marker
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The ::marker
CSS pseudo-element 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
, such as the <li>
and <summary>
elements.
Try it
Allowable properties
The ::marker
pseudo-element supports a limited number of CSS properties, including:
- All font properties
- The
white-space
property color
text-combine-upright
,unicode-bidi
, anddirection
properties- The
content
property - All animation and transition 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
Specifications
Specification |
---|
CSS Pseudo-Elements Module Level 4 # marker-pseudo |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
::marker | ||||||||||||
Animation and transition support |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
See also
- HTML elements that have marker boxes by default:
<ol>
,<li>
,<summary>
- CSS generated content module
- CSS lists and counters module
- CSS counter styles module