How to change the color of the text selection of your website?

Often times, we don’t even care what is the color if some user selects the text in our website. However, if you do some tweaking then it would be really awesome. You can change the color of the selection and the background in your website.

The code you can use to give a nice feel is as follows:

/* This piece of code will be used for the mozilla based websites */

::-moz-selection {
background-color: #ff6200;
color: #fff;
}

/* This will take care of browsers like safari */

::selection {
background-color: #ff6200;
color: #fff;
}

/*For webkits */

::-webkit-selection { background-color: #FFA; color: #000; }

You can choose whatever color you want in the code above. Good luck. Leave comments if you like this post. Thanks.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s