Advertisement
shakil97bd

Changing the highlight color when selecting text

Apr 12th, 2015
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.76 KB | None | 0 0
  1. ***************** Changing the highlight color when selecting text in an HTML text input ********************
  2.  
  3. Just paste this bellow code in your style.css file to change the highlight color when selecting text.This code is cross browser supported.
  4.  
  5.  
  6.  
  7.  
  8. /* For Changing the highlight color when selecting text */
  9.  
  10. /* Works on common browsers */
  11. ::selection {
  12.     background-color: #BD4932;
  13.     color: #fff;
  14. }
  15.    
  16. /* Mozilla based browsers */
  17. ::-moz-selection {
  18.     background-color: #BD4932;
  19.     color: #fff;
  20. }
  21. /* For Other Browsers */
  22. ::-o-selection {
  23.     background-color: #BD4932;
  24.     color: #fff;
  25. }
  26. ::-ms-selection {
  27.     background-color: #BD4932;
  28.     color: #fff;
  29. }
  30.  
  31. /* For Webkit */
  32. ::-webkit-selection {
  33.     background-color: #BD4932;
  34.     color: #fff;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement