CSS · More selectors

::target-text

Styles the text highlighted by a URL text fragment.

Syntax
::target-text

Example

Try it

More in this group

::backdrop ::file-selector-button ::first-letter ::first-line ::marker ::part() ::slotted() :autofill

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course