简体   繁体   中英

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.

use

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

from HTML5 BoilerPlate

I found this CSS in that page:

::selection {
  background: #E02F86;
  color: white;
}

Also, tried it here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM