Changing the text highlight colour with CSS

If you’ve seen websites display different foreground or background colours on highlighted text and wonder how they do it, it’s actually very simple. Once part of the draft CSS Selectors Level 3 specification ::selection overrides your browser-level or system-level text highlight color with a color of your choosing. Here’s an example: As mentioned, the ::selection pseudo-element […]

Read More