How to change the color of css3 text

check that there are 2 methods on the Internet, one kind of background-image, one kind of-webkit-mask-image, but I tried it without any effect. Is there any other better method, mobile?

Mar.28,2021

https://blog.csdn.net/qq_3637.


set the gradient with backgroung-image , and then use background-clip: text to set the background to be displayed only on text. Firefox does not need a prefix, and chrome needs the prefix -webkit- prefix


the following attributes are set on the text:
background:-webkit-linear-gradient (rgba (77pint 142webkit-background-clip: text; 241pl) 1% webkit-background-clip: text; RGBA (105ju 124 webkit-background-clip: text; 238 webkit-background-clip: text; 1) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;


background:-webkit-linear-gradient (rgba (7 L1) 1% pari RGBA (
-webkit-text-fill-color: transparent;

Menu