:past
:past CSS 伪类选择器是一个时间维度伪类,它匹配所有完全出现在匹配 :current 的元素之前的元素。例如,在通过 WebVTT 显示字幕的视频中。
css
:past(p, span) {
display: none;
}
语法
css
:past {
/* ... */
}
示例
CSS
css
:past(p, span) {
display: none;
}
HTML
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
规范
| 规范 |
|---|
| 选择器 Level 4 # the-past-pseudo |
浏览器兼容性
加载中…