Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webkit CSS - Selector to Change Color of Highlight

I noticed a cool effect in Chrome at this site, which may or may not be unique to Chrome but possibly for all Webkit browsers.

When the user drags to highlight something, they've changed the default color to pink.

Can you identify the selector?

I would like to see if someone knows of a reference page which describes these kinds of effects.

like image 612
Dale Rollinson Avatar asked Dec 05 '22 18:12

Dale Rollinson


1 Answers

use

::-moz-selection,
::selection{
    background: #fe57a1;
    color: #fff;
    text-shadow: none;
}

from HTML5 BoilerPlate

like image 110
Zoltan Toth Avatar answered Dec 11 '22 10:12

Zoltan Toth