Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

:future — the future timeline pseudo-class

The :future pseudo-class identifies content after the current position on a host-defined timeline. In WebVTT, it styles future portions of an active cue through ::cue(:future); it does not select HTML elements that will be created later.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

:future
::cue(:future)

:future takes no arguments. It represents an element occurring entirely after a :current element on a timeline defined by the host language. Without a defined timeline, it matches nothing. If the language does not define a temporal ordering of elements, the specification uses following siblings of :current; this does not create a timeline for ordinary HTML.

In WebVTT, ::cue(:future) selects internal cue nodes preceded by a timestamp greater than the current playback position. This concerns a portion of an already displayed cue, not an entire cue waiting to start. At equality, that timestamp does not satisfy the greater-than condition. :past describes a separate past state.

The example changes Beta from yellow to white after the timestamp is crossed. color is allowed in this rule; font properties such as font-size do not apply to ::cue() containing :future or :past.

The Selectors Level 5 definition is a draft. Do not assume support in every browser or infer it merely from selector parsing. The example is illustrative and requires local rendering verification.

Examples

CSS
video::cue { color: white; }
video::cue(:future) { color: yellow; }

WebVTT
WEBVTT

00:00:00.000 --> 00:00:08.000
<c>Alpha</c> <00:00:04.000><c>Beta</c>

Result

Expected with the cue displayed and these styles applied:
currentTime = 2: Alpha is white; Beta is yellow.
currentTime = 5: Alpha is white; Beta is white.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources