speak-as CSS propertyExperimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The speak-as CSS property is used to define how HTML content is spoken. The one to three enumerated key terms determine the manner by which elements and text get rendered by aural technologies, such as screen readers and digital assistants.
This property applies to all content, including pseudo-elements, with the exception ::marker pseudo-elements constructed via a @counter-style with a defined speak-as descriptor, which takes precedence over any inherited speak-as property value.
/* single value syntax */
speak-as: normal;
speak-as: spell-out;
speak-as: literal-punctuation;
speak-as: digits;
speak-as: no-punctuation;
/* multiple value syntax */
speak-as: spell-out literal-punctuation;
speak-as: spell-out no-punctuation;
speak-as: digits literal-punctuation;
speak-as: digits no-punctuation;
speak-as: spell-out digits literal-punctuation;
speak-as: spell-out digits no-punctuation;normalNormal pronunciation rules with punctuation replaced by pauses. For example, "Hello, world!" would be pronounced as "Hello (pause) world (pause)". This is the default value.
spell-outContent is spelled out letter by letter. For example, "role" would be pronounced as "r" "o" "l" "e".
literal-punctuationPunctuation marks are spelled out literally. For example, "Hello, world!" would be pronounced as "Hello comma world exclamation mark."
digitsNumbers are pronounced as individual digits. For example, "31" would be pronounced as "three one".
no-punctuationContent is pronounced normally without any punctuation. For example, "Hello, world!" would be pronounced as "Hello" "world".
Note: Support of the speak-as property is limited and inconsistently implemented across different assistive technologies, such as screen readers or speech synthesizers. To ensure any pronunciation-dependent critical information remains user-friendly and accessible to a wide audience, do not rely solely on this CSS property to define how this information content is presented aurally.
| Initial value | auto |
|---|---|
| Applies to | all elements |
| Inherited | yes |
| Computed value | specified value |
| Animation type | discrete |
speak-as =
normal |
spell-out || digits || [ literal-punctuation | no-punctuation ]
<p class="normal">Hello, world! I'm 25.</p>
<p class="spell-out">Hello, world! I'm 25.</p>
<p class="literal-punctuation">Hello, world! I'm 25.</p>
<p class="no-punctuation">Hello, world! I'm 25.</p>
<p class="digits">Hello, world! I'm 25.</p>
<p class="multi">Hello, world! I'm 25.</p>.normal {
speak-as: normal;
}
.spell-out {
speak-as: spell-out;
}
.literal-punctuation {
speak-as: literal-punctuation;
}
.no-punctuation {
speak-as: no-punctuation;
}
.digits {
speak-as: digits;
}
.multi {
speak-as: literal-punctuation digits;
}@counter-style at-rule speak-as descriptor