::selection {
background: #ffb7b7;
}
::-moz-selection {
background: #ffb7b7;
}
Also for more information you can see this .
p::selection { background: #FEAA90; } p::-moz-selection { background: #FEAA90; }
<p>Click on "Run code snippet" and select this text.</p>
You can do by ::selection Pseudo-element
For example:
::selection {
color: red;
background: #FEAA90;
}
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.