CSS怎么实现文字的渐变

主要用到3个属性

 linear-gradient() 用来实现渐变的图像

    background-clip 知道对象的悲剧图像向外裁剪的区域

    text-fill-color 指定文字的填充颜色

例如:

<p><a href="#">某市某某生物科技有限公司</a></p>

<style>
  p > a{
            /*to  top指从下到上的渐变*/
      background: linear-gradient(to top,#33CC99 0%,#006666 100%);
      background-clip: text;
      -webkit-background-clip: text;
      text-fill-color: transparent;
      -webkit-text-fill-color: transparent;
    }
</style>

效果如下:

猜你喜欢

转载自blog.csdn.net/Lean_on_Me/article/details/82941495