CSS supports the following cue pseudo-element to format the appearance of the cues appearing within a media clip:
::cue {
styles
}
The styles for the cue pseudo-element are limited to the background, color, font, opacity, outline, text-decoration, text-shadow, visibility, and white-space properties. For example, the following style rule displays all cues in a 2em yellow serif font on a red background:
::cue {
background: red;
color: yellow;
font: 2em serif;
}
The cue pseudo-element selects all of the cue text in the media clip. To format specific cues or text strings within a cue, a user can identify the sections of the cue text using the following markup tags:
• <i></i> for italicized text
• <b></b> for bold-faced text
• <u></u> for underlined text
• <span></span> to mark spans of text
• <ruby></ruby> to mark ruby text
• <rt></rt> to mark ruby text
WebVTT also supports tags that are not part of the HTML library, such as the following <c></c> tag used to mark text strings belonging to a particular class:
<c.classname></c>
Here, classname defines the class.
And for captions that distinguish one voice from another, WebVTT supports the following <v></v> tag:
<v name></v>
Here, name is the name of the voice associated with the caption.
For cues based on their class name, add the class name to the cue pseudo-element as follows:
::cue(.classname) {
style rules
}
Here, classname is the class marked within in the <c></c> tag.
To format voice text, use the style rule as follows:
::cue(v[voice=name]) {
style rules
}
Here, name is the name assigned in the <v></v> tag.