Tuesday, March 12

How to change background color of selected text

I was willing to see how some of websites have beautiful colors when we select text on the pages. Just searching for the trick and got that its a simple CSS property to override default behaviour of browsers. You have to just apply background color and its done, more over if you want to change the text color also you can apply color in CSS. This simple CSS class will do it all for you.
::-moz-selection{
    background:#66b0e6;
 }
 ::selection{
 background:#66b0e6;
 }
Fiddle : (select the text below)
Post a Comment