Change Color of Selected Text

/ Published in: CSS
Save to your folder(s)

Change the color and background color of selected text using only css. Compatible with Firefox and Safari, but not Internet Explorer

Copy this code and paste it in your HTML
  1. ::-moz-selection
  2. {
  3. background:#6374AB;
  4. color:#fff;
  5. }
  7. ::selection
  8. {
  9. background:#6374AB;
  10. color:#fff;
  11. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.