Псевдоэлемент ::marker
применяет стили к маркеру элемента списка, которые обычно содержит значок или номер. Работает с любым элементом или псевдоэлементом, к которого установлен display: list-item
, например, у такого как <li>
или <summary>
.
::marker {
color: blue;
font-size: 1.2em;
}
Разрешённые свойства
Только некоторые CSS-свойства могут быть использованы с ::marker
в качестве селектора:
- Все свойства шрифтов
white-space
color
text-combine-upright
,unicode-bidi
иdirection
- Свойство
content
- Все animation и transition свойства
The specification states that additional CSS properties may be supported in future.
Syntax
::marker
Examples
HTML
<ul>
<li>Peaches</li>
<li>Apples</li>
<li>Plums</li>
</ul>
CSS
ul li::marker {
color: red;
font-size: 1.5em;
}
Result
Specifications
Specification | Status | Comment |
---|---|---|
CSS Pseudo-Elements Level 4 Определение '::marker' в этой спецификации. |
Рабочий черновик | No significant change. |
CSS Lists Module Level 3 Определение '::marker' в этой спецификации. |
Рабочий черновик | Initial definition. |
Browser compatibility
BCD tables only load in the browser
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.