CSS Masterclass
Custom Text Selection Color
Make your website highlight color match your brand identity in 2 minutes.
✨ Interactive Preview
Select this text to see the custom Pink highlight! ✨
(Drag your mouse over the text above)
💻 Copy the Source Code
GLOBAL_STYLE.CSS
/* Change selection color for all elements */
::selection {
background: #e1306c; /* Your Brand Color */
color: #ffffff; /* Text Color */
}
/* Firefox Support */
::-moz-selection {
background: #e1306c;
color: #ffffff;
}
Why use this code?
- Consistency: No more generic blue highlights.
- UX Polish: Small details build user trust.
- Accessibility: Ensure high contrast for readability.