Saturday, April 11, 2015

Change Text Selection color - CSS Snippet

Change Text Selection color - CSS Snippet

All newer browsers will allow you to define the selection color on your page. This is set to light blue by default, but you can setup any color value which tickles your fancy. This snippet includes the typical ::selection target along with vendor prefixes for Webkit and Mozilla.

::selection { background: #e2eae2; }
::-moz-selection { background: #e2eae2; }
::-webkit-selection { background: #e2eae2; }
Disqus Comments