::search-text

A pseudo-element that allows you to style text that matches a 'find in page' search query. This lets you customize how highlighted search results appear in your site.

This is an experimental technology. The syntax and behavior are still subject to change.

/* Usage Example */
::search-text {
  /* Customizes the look of text that matches the browser's search highlighter */
  background-color: var(--brand-glow);
  color: white;
  text-decoration: underline;
}
Limited availability Since 2020 48% global usage

This feature is not Baseline because it does not work in some of the most widely-used browsers.

144+
144+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC