A short CSS tutorial showing how to change the colour of selected text on a web page using the ::selection pseudo-element. It suits people building websites who want a small visual detail that improves the user experience.
What you’ll learn
✓Style selected text colour with the ::selection pseudo-element
✓Set background and text colours for highlighted content in CSS