Candidate Recommendation Draft · webvtt

WebVTT: The Web Video Text Tracks Format

2 selectors defined by this specification, 1 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

::cue

Selector Baseline: widely availablesince January 2018

Spec The ::cue pseudo-element (with no argument) matches any list of WebVTT Node Objects constructed for the matched element, with the exception that the properties corresponding to the background shorthand must be applied to the WebVTT cue background box rather than the list of WebVTT Node Objects.

MDN The ::cue CSS pseudo-element matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks.

Live preview Example from MDN
video {
  width: 100%;
}

video::cue {
  font-size: 1rem;
  color: yellow;
}

::cue(u) {
  color: red;
}

Syntax

::cue

::cue(selector)

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting ::cue
Chrome 26
Edge 79
Firefox 55
Safari 7
Chrome Android 26
Safari iOS 7

First version with support, from MDN browser-compat-data.

::cue-region

Selector Not in any browser yet

Spec The ::cue-region pseudo-element (with no argument) matches any list of WebVTT region objects constructed for the matched element.

Syntax

::cue-region

::cue-region(selector)

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.