::marker - CSS: Cascading Style Sheets 编辑
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.
::marker {
color: blue;
font-size: 1.2em;
}
Allowable properties
Only certain CSS properties can be used in a rule with ::marker
as a selector:
- All font properties
- The
white-space
property color
text-combine-upright
,unicode-bidi
anddirection
properties- The
content
property - All animation and transition properties
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 The definition of '::marker' in that specification. | Working Draft | No significant change. |
CSS Lists Module Level 3 The definition of '::marker' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论