css font gradient style (set font gradient style + additional implementation source code)

Problem Description

Look at the renderings first.
insert image description here

solution

Add the following code in the corresponding css style.
My product list is in shangpinliebiaobiaotit-viewthe class, so I am shangpinliebiaobiaotit-viewsetting the css gradient style.

<view class="shangpinliebiaobiaotit-view">商品列表</view> 

Realize font gradient style CSS code
注意: Must use background-image, I tried it before background-coloror colorit didn’t work, adjust it according to the following, my requirement here is to make a gradient from left to right, so here I use to right, from left to right, If your requirement is to use it from right to left to left, there are four gradient directions: to right, to left, to top, to bottom, adjust according to your needs, #316DFB, #57D4F8this is the color value, the first color and the second, the first color value is darker Some, my gradient is from dark to light.

background-image: linear-gradient(to right, #316DFB, #57D4F8);
-webkit-background-clip: text;
color: transparent;

Guess you like

Origin blog.csdn.net/xiaohua616/article/details/132115755