::highlight

Targets custom text highlights created via the CSS Highlight API. It allows you to style specific ranges of text programmatically (ideal for search-and-highlight features).

Quick example

::highlight(search-result) {
  /* Styles text found via a search script */
  background-color: yellow;
  color: black;
}

::highlight Browser Support

Newly availableSince 202692% global usage

Since 2026 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Works in all modern browsers. May need a fallback for older browsers.

105+
149+
17.2+
105+
Interop 2026 focus area?Learn more →
ESC