Code Snippets

Change Text Selection Color With CSS

Comments (1)
  1. tzi says:

    Hi!

    Thanks for sharing your discoveries.

    I can complete it a bit.
    There is only the “-moz-” vendor, others do not exist: http://caniuse.com/#feat=css-selection

    The folowing lines are good enough:
    /* Mozilla based browsers */
    ::-moz-selection {
    background-color: #FF68B0;
    color: #FFF;
    }
    /* Works in IE, chrome, safari & opera */
    ::selection {
    background-color: #FF68B0;
    color: #FFF;
    }

    Cheers,
    Thomas.

Leave a Reply

Your email address will not be published. Required fields are marked *