::search-text
Limited availability70% of usersExperimental
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.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in yet, so not every major browser supports it.
See how modern your own CSS is.Check your CSS →
Quick 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;
}::search-text browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage70%of people can use this30% use a browser without it.
Browsers
144+
144+Mobile
144+Android