::target-text
A pseudo-element that allows you to style text that has been targeted via a URL fragment (the part after the # in a URL). This is often used for 'scrol-to-text' highlights.
Syntax
/* Usage Example */
::target-text {
/* Customizes the highlight color when the user arrives at this specific text via a link */
background-color: var(--brand-highlight);
color: black;
}
::target-text Browser support
Newly available
Since
2024 92% global usage
Since 2024 this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
89+
131+
18.2+
89+