Summary
The speak-as descriptor specifies how a counter symbol constructed with a given @counter-style will be represented in the spoken form. For example, an author can specify a counter symbol to be either spoken as its numerical value or just represented with an audio cue.
The value of the speak-as descriptor can be auto, bullets, numbers, words, spell-out, or the name of another counter style.
| Related at-rule | @counter-style |
|---|---|
| Initial value | auto |
| Media | all |
| Computed value | as specified |
| Canonical order | the unique non-ambiguous order defined by the formal grammar |
Syntax
/* Keyword values */ speak-as: auto; speak-as: bullets; speak-as: numbers; speak-as: words; speak-as: spell-out; /* @counter-style name value */ speak-as: <counter-style-name>;
Values
- auto
- If the value of
speak-asis specified as auto, then the effective value ofspeak-aswill be determined based on the value of thesystemdescriptor. If the value ofsystemis alphabetic, then the effective value ofspeak-aswill be spell-out. Ifsystemis cyclic, the effective value ofspeak-aswill be bullets. Ifsystemis extends, the value ofspeak-aswill be the same as ifspeak-as: auto is specified on the extended style. For all other cases, the specifying auto has the same effect as specifyingspeak-as: numbers. - bullets
- A phrase or an audio cue defined by the user agent for representing an unordered list item will be read out.
- numbers
- The numerical value of the counter will be read out in the document language.
- words
- The user agent will generate a counter value as normal and read it out as a word in the document language.
- spell-out
- The user agent will generate a counter representation as normal and would read it out letter by letter. If the user agent doesn't know how to read out a partiular counter symbol, the user agent might read it out as if the value of
speak-aswas numbers. - <counter-style-name>
- If the name of another counter style is specified, the counter will be spoken out in the form specified in that counter style, kind of like specifying the
fallbackdescriptor. If the specified style does not exist, speak-as descriptor assumes the value auto.
Formal syntax
auto | bullets | numbers | words | spell-out | <counter-style-name>where
<counter-style-name> = <custom-ident>
Example
HTML
<ul class="list"> <li>One</li> <li>Two</li> <li>Three</li> <li>Four</li> <li>Five</li> </ul>
CSS
@counter-style speak-as-example {
system: fixed;
symbols: ;
suffix: " ";
speak-as: numbers;
}
.list {
list-style: speak-as-example;
}
Result
Specifications
| Specification | Status | Comment |
|---|---|---|
| CSS Counter Styles Level 3 The definition of 'speak-as' in that specification. |
Candidate Recommendation | Initial definition. |
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
list-style,list-style-image,list-style-positionsymbols(), the functional notation creating anonymous counter styles.