天天看点

CSS 设置网页中选中文字的背景色

在css样式文件中增加如下代码:(建议放在文件最上方)

::selection {
background: hsla(5, 92%, 76%, 0.8);
color: #fff;
}