Summary
The prefix descriptor of the @counter-style
rule allows authors to specify a symbol that will be prepended to the marker representation. If no value is specified, the default value will be the empty string.
Syntax
/* <symbol> values */
prefix: "»";
prefix: "Page";
Values
<symbol>
- Specifies a
<symbol>
that is prepended to the marker representation.
<symbol>where
<symbol> = <string> | <image> | <ident>
Example
HTML Content
<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>
CSS Content
@counter-style chapters {
system: numeric;
symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
prefix: 'Chapter ';
}
.index {
list-style: chapters;
}
Result
Specifications
Browser compatibility
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari |
Basic support |
No support |
33 (33) |
No support |
No support |
No support |
Feature |
Android |
Firefox Mobile (Gecko) |
IE Mobile |
Opera Mobile |
Safari Mobile |
Basic support |
No support |
33 (33) |
No support |
No support |
No support |
See also
Document Tags and Contributors