CSS Reference ยท Properties for Special Contexts
Speech properties (CSS Speech)
What the CSS Speech module is, which properties it defines, why browsers do not support them, and what to use instead to control how screen readers read a page.
The CSS Speech module describes a way to style how a page sounds, the same way normal CSS styles how it looks. It defines properties for speaking, pausing, adding audio cues and choosing a voice. The idea is old: its ancestor, "aural stylesheets", appeared in CSS 2, and the current module is the modern rewrite.
The important fact for day-to-day work is the status: web browsers do not implement these properties in a way you can rely on. Screen readers read the accessibility tree built from your HTML, not your CSS voice settings. This page lists what exists, so you recognize the names, and then shows the techniques that actually control spoken output today.
/* Defined by the CSS Speech module, but not usable in practice */ .note { speak: always; voice-family: female; pause-before: 200ms; cue-before: url(ding.wav); }
Try it
Speech output cannot be demonstrated in a preview, but the most useful real technique can: text that is present for assistive technology but not drawn on screen. Tick the box to reveal the hidden words.
What the module defines
This is a concept page, so here is the vocabulary instead of a value table.
| Property | Intended purpose |
|---|---|
speak |
Whether an element is spoken at all (auto, never, always) |
speak-as |
How content is read: normal, letter by letter, digits, punctuation |
voice-volume, voice-rate, voice-pitch, voice-range, voice-stress |
Loudness, speed and intonation of the voice |
voice-family, voice-balance |
Which voice to use and its stereo position |
pause, pause-before, pause-after |
Silence before and after an element |
rest, rest-before, rest-after |
Silence inside the element's own boundaries |
cue, cue-before, cue-after |
Short sounds played around an element |
Usage notes
- Do not rely on any of them. Major browsers do not implement the module, and mainstream screen readers ignore it. A small amount of partial support for
speak-ashas been reported in some engines; if you ever need it, check a current compatibility table first and treat it as an optional enhancement. - Control speech with HTML, not CSS. Headings, landmarks, lists, labels and
alttext decide what assistive technology says. Good structure is the real "voice styling". - Hide from everyone with
display: noneorvisibility: hidden: the content leaves both the screen and the accessibility tree. - Hide from sight only with a visually hidden class, as in the example. Do not use
display: nonefor this, or screen readers will skip the text too. - Hide from assistive technology only with the HTML attribute
aria-hidden="true"(for decorative icons), never on focusable elements. - Generated content is read. Text added with
contentin::beforeor::afteris usually announced, so avoid putting meaningful or noisy text there. - Spoken pronunciation is best handled with plain words, the
langattribute, and ARIA labels, not CSS.
Browser support
The CSS Speech properties have no dependable support in browsers or screen readers; use semantic HTML and ARIA instead.
Related
displayโnoneremoves content from the accessibility treevisibilityโ hides content but keeps its spacecontentโ generated content is exposed to assistive technologyclip-pathโ used by the visually hidden technique- Lesson: CSS Accessibility