Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradient background color on ::selection

Is there is a way to add gradient color to CSS ::selection?


if I use something like this:

::selection {
  background-image: -webkit-linear-gradient(left, #ee4037 0%, #eb297b 100%);
}

It does not work.

like image 717
Erez Lieberman Avatar asked Nov 26 '15 15:11

Erez Lieberman


1 Answers

No.

Per 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.

like image 58
Paulie_D Avatar answered Oct 08 '22 17:10

Paulie_D