When a user highlights text on a website it turns blue by default. You can easily change this to some snazzy color scheme instead by pasting the following code in your style sheet.
It’s fun to play around with different colors, try red and white for a candy cane look! I’m using a fun shade of green in this example, you can see it in action when you highlight the text.
::selection { background: #93CE52; /* Safari */ color: #ffffff; } ::-moz-selection { background: #93CE52; /* Firefox */ color: #ffffff; }
Like this tutorial? I would love to hear from you in the comments…
I love this! I think all web designers should pay attention to the little details.
One of my clients text is pink when highlighted, on her blog, and I have been wondering how to do this. Thanks so much for the tutorial!