::selection 上的渐变背景颜色

Gradient background color on ::selection

有没有办法给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.