CSS Browser Text Selection Color Change

October 27th, 2014 | CSS | Kumar Gaurav

CSS Browser Text Selection Color Change - UXINME

This CSS trick will allow you to change color of browser default text selection. As of now this works in Mozilla, Safari, Chrome or any Webkit browser. If you have your website working on IE then it will fallback to its default blue color.

Just copy following code and paste in to your CSS file and see the magic!


/* Mozilla based browsers */
::-moz-selection {
       background-color: #FFA;
       color: #000;
}

/* Works in Safari */
::selection {
       background-color: #FFA;
       color: #000;
}

 

Don't Be Selfish...Share on Facebook1Tweet about this on TwitterShare on LinkedIn0Share on Google+0Share on StumbleUpon0Share on Tumblr0Email this to someone

Having more than 5 years of experience in User Experience Design. My objective is to identify and solve design/architectural problems in the products we use or the product I work for. The methods are always same "User Centric Design" but execution is something which makes this field exciting and challenging. I aim to create engaging designs and experience that inform, inspire and entertain.