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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With