zoukankan      html  css  js  c++  java
  • css设置字体渐变色

    参考  https://www.cnblogs.com/ypppt/p/13334613.html

    我设置的第一种

      1. background: linear-gradient(to right, redblue);
      2. -webkit-background-clip: text;
      3. color: transparent;

    网上说的

    .gradient-text-one{ 

        background-image:-webkit-linear-gradient(bottom,red,#fd8403,yellow);
        -webkit-background-clip:text;
        -webkit-text-fill-color:transparent;
    }
    background: -webkit-linear-gradient(...) 为文本元素提供渐变背景。
    webkit-text-fill-color: transparent 使用透明颜色填充文本。 
    webkit-background-clip: text 用文本剪辑背景,用渐变背景作为颜色填充文本。
     
    第二种
    .gradient-text-two{
       color:red;
    }
    .gradient-text-two[data-content]::after{
        content:attr(data-content);
        display: block;
        position:absolute;
        color:yellow;
        left:0;
        top:0;
        z-index:2;
        -webkit-mask-image:-webkit-gradient(linear, 0 0, 0 bottom, from(yellow), to(rgba(0, 0, 255, 0)));
    }
    mask-image 和 background-image 一样,不仅可以取值是 图片路径,也可以是渐变色。  
     
     
  • 相关阅读:
    Common Element in Two Sorted Sets
    Nearest Points on a Plane
    Influencer Finder
    Range of Intervals
    *Common characters
    自定义栈 和装箱,拆箱
    1.Vector(同步)和ArrayList(异步)异同
    STL中的迭代器的使用
    如何优化limit?
    mysql五大引擎之间的区别和优劣之分
  • 原文地址:https://www.cnblogs.com/wdd-cindy/p/14865523.html
Copyright © 2011-2022 走看看