Changing the Text Selection Colours on Web Pages

Here’s a useful bit of css. If you have a site with light coloured text and you want to select and copy some of it, it might not be so easy to see what you have highlighted.

On this blog I have used the following code to make the selcted text more legible:

*::-moz-selection { background-color: #390; color: #FFF; }
*::selection    { background-color: #390; color: #FFF; }

This works on Firefox, Safari, Google Chrome and Opera. Internet Explorer does it’s own thing (as usual) and gives you blue on white by default.

other page

What do you think?

It's good to talk!

Your email address will not be published. Required fields are marked *