Posted By

neal_grosskopf on 03/09/08


Tagged

css CSS3


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

neal_grosskopf
SpinZ
Wiederkehr
wizard04


Change Text Selection Color Using CSS


 / Published in: CSS
 

URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=5

Change selection color using CSS. Works in most modern browsers except for IE.

  1. ::selection { background: red; color: white; }
  2. ::-moz-selection { background: red; color: white; }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: SmpleJohn on March 10, 2008

Kind of nice, doesn't validate with W3C though.

Posted By: neal_grosskopf on March 10, 2008

The -moz selector is still in beta stage for firefox but the ::selection selector is valid CSS3. The CSS validator hasn't been update yet for CSS3.

You need to login to post a comment.