Spec-Zone.ru › CSS

`:past` CSS pseudo-class

Baseline Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The :past CSS pseudo-class selector is a time-dimensional pseudo-class that will match for any element which appears entirely before an element that matches :current. For example in a video with captions which are being displayed by WebVTT.

:past(p, span) {
  display: none;
}

Syntax

:past {
  /* ... */
}

Examples

CSS

:past(p, span) {
  display: none;
}

HTML

<video controls preload="metadata">
  <source src="video.mp4" type="video/mp4" />
  <source src="video.webm" type="video/webm" />
  <track
    label="English"
    kind="subtitles"
    srclang="en"
    src="subtitles.vtt"
    default />
</video>

WebVTT

WEBVTT FILE

1
00:00:03.500 --> 00:00:05.000
This is the first caption

2
00:00:06.000 --> 00:00:09.000
This is the second caption

3
00:00:11.000 --> 00:00:19.000
This is the third caption

Specifications

Specification
Selectors Level 5
# the-past-pseudo

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS
past
23
79
No
15
7
25
No
14
7
1.5
4.4
7

See also

  • Web Video Text Tracks Format (WebVTT)
  • :current
  • :future

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:past

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API