The prefix
descriptor of the @counter-style
rule specifies content that will be prepended to the marker representation. If not specified, the default value will be ""
(an empty string).
The prefix
descriptor of the @counter-style
rule specifies content that will be prepended to the marker representation. If not specified, the default value will be ""
(an empty string).
/* <symbol> values */ prefix: "»"; prefix: "Page "; prefix: url(bullet.png);
<symbol>
Specifies a <symbol>
that is prepended to the marker representation. It may be a <string>
, <image>
, or <custom-ident>
.
Related at-rule | @counter-style |
---|---|
Initial value | "" (the empty string) |
Computed value | as specified |
<symbol> <symbol> = <string> | <image> | <custom-ident>
<ul class="index"> <li>The Boy Who Lived</li> <li>The Vanishing Glass</li> <li>The Letters from No One</li> <li>The Keeper of the Keys</li> <li>Diagon Alley</li> </ul>
@counter-style chapters { system: numeric; symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"; prefix: 'Chapter '; } .index { list-style: chapters; padding-left: 15ch; }
Specification |
---|
CSS Counter Styles Level 3 # counter-style-prefix |
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
prefix |
91 |
91 |
33 |
No |
77 |
No |
91 |
91 |
33 |
64 |
No |
16.0 |
list-style
, list-style-image
, list-style-position
symbols()
, the functional notation creating anonymous counter styles
© 2005–2022 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/@counter-style/prefix