Implementation in background-clip + Text-fill-color
If your browser is chrome or Safari, you can see the following effects on the demo page:
<H2Class= "Text-gradient">Tianci meiniu</H2>
CSS (CSSCodeIs actually the last three lines ):
. Text-Gradient {
Display : Inline-block ;
Color : Green ;
Font-size : 10em ;
Ont-family : '' ;
Background-Image : -WebKit-gradient (linear, 0 0, 0 bottom, from (rgba (0,128, 0, 1), to (rgba (51, 51, 51, 1 ))) ;
-WebKit-Background-clip : Text ;
-WebKit-text-fill-color : Transparent ;
} ;
Conclusion
Currently, the text-fill-color attribute seems to be supported by the WebKit core browser, so the gradient effect can only be seen on the two demo pages in chrome or safari. Solid color in Firefox, not to mention in IE.
However, the text gradient itself is a decorative function. Therefore, based on the progressive enhancement principle, we can use it boldly in actual projects. Just a few lines of CSS code without affecting the original functions, so that Chrome browsers with higher shares have a better visual experience. Why not?