::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).
Syntax
/* Usage Example */
::highlight(search-result) {
/* Styles text found via a search script */
background-color: yellow;
color: black;
}
::highlight Browser support
Widely available
Since
2015 92% global usage
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.
105+
140+
17.2+
105+