how to change the default text selection color in Browser

One of those cool CSS3 declarations that you can use today is ::selection, which overrides your browser-level or system-level text highlight color with a color of your choosing. The biggest hit is in the fact that only Safari and Firefox are supporting this, and both in slightly different ways. IE totally ignores them. Fortunately, this can be thought of as one of those “forward-enhancement” techniques. It’s a nice touch for those using modern browsers, but it just gets ignored in other browsers and it’s not a big deal.

I feel it’s worth a mention and am posting it. The solution for this text highlighting is a small CSS fix shown below:

::selection {
background: #ffb7b7; /* Safari */
::-moz-selection {
background: #ffb7b7; /* Firefox */

[ VIEW DEMO ] – Try using your mouse to select the text.

If you are able to find a fix for this in IE, please feel free to share it.

Feel free to leave a reply here...

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: