CSS

标记 | ::marker

::marker

这是一种实验技术

由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。另外请注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。

::marker元素代表一个列表项的标记框(<li>)。标记通常是一个项目符号或数字。

::marker { color: red; font-size: 1.5em; }

只有一小部分CSS属性可以使用::marker

  • color

  • text-combine-upright

  • 全部字体属性

HTML

<ul> <li>Peaches</li> <li>Apples</li> <li>Plums</li> </ul>

CSS

::marker { color: red; font-size: 1.5em; }

结果

规格

SpecificationStatusComment
CSS Pseudo-Elements Level 4The definition of '::marker' in that specification.Working DraftNo significant change.
CSS Lists and Counters Module Level 3The definition of '::marker' in that specification.Working DraftInitial definition.

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic supportNo supportNo supportNo supportNo supportNo support

FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic supportNo supportNo supportNo supportNo supportNo supportNo support