Skip to main content

Harshal V. LADHE

CSS Pseudo-Classes

Selecting elements by state, such as open, checked, playing or focused, with CSS pseudo-classes and their fallbacks.

Content tagged pseudo-classes

  • Snippet::playing and :paused: Style Media by Playback State

    Style audio and video players from their playback state.
    Style audio and video by playback state with CSS :playing, :paused, :buffering and :muted, plus :has() patterns and a JavaScript fallback.
    Published at:
    Categories:CSS
    Estimated reading time:7 min read
  • Tutorial:The :open Pseudo-Class for <details>, <dialog> and <select>

    Style anything that opens, selects included, with one pseudo-class.
    Style the open state of <details>, <dialog> and <select> with the CSS :open pseudo-class. Compare it with [open], :popover-open and :modal, with fallbacks.
    Published at:
    Categories:CSS
    Estimated reading time:11 min read