有没有办法为CSS :: selection添加渐变颜色?
如果我使用这样的东西:
::selection { background-image: -webkit-linear-gradient(left,#ee4037 0%,#eb297b 100%); }
这是行不通的.
解决方法
没有.
每MDN
Only a small subset of CSS properties can be used in a rule using ::selection in its selector: color,background-color,cursor,outline,text-decoration,text-emphasis-color and text-shadow. Note that,in particular,background-image is ignored,like any other property.