Problem Description
Look at the renderings first.
solution
Add the following code in the corresponding css style.
My product list is in shangpinliebiaobiaotit-view
the class, so I am shangpinliebiaobiaotit-view
setting the css gradient style.
<view class="shangpinliebiaobiaotit-view">商品列表</view>
Realize font gradient style CSS code
注意
: Must use background-image
, I tried it before background-color
or color
it 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, #57D4F8
this 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;