::cue (:cue)
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
* Some parts of this feature may have varying levels of support.
::cue CSS 伪元素匹配所选元素中的WebVTT提示。这可以用于在 VTT 轨道的媒体中使用字幕和其他线索。
只有 CSS 一小部分属性可以与 ::cue 伪元素一起使用:
coloropacityvisibilitytext-decorationand its longhand properties:text-decoration-line,text-decoration-color, andtext-decoration-styletext-shadowbackgroundand its longhand properties:background-color,background-clip,background-image,background-origin,background-position,background-repeat,background-size,background-attachment, andbackground-blend-modeoutlineand its longhand properties:outline-color,outline-style,outline-widthfontand its longhand properties:font-kerning,font-style,font-variant,font-variant-numeric,font-variant-position,font-variant-east-asian,font-variant-caps,font-variant-alternates,font-variant-ligatures,font-synthesis,font-feature-settings,font-language-override,font-weight,font-size,font-size-adjust,font-stretch, andfont-familyline-heightwhite-spacetext-combine-uprightruby-position
属性应用于整个提示集,就像它们是单个单元一样。唯一的例外是背景及其简写属性可以单独应用于每个提示,以避免创建框并遮盖意外大面积的媒体。