【CSS】 css 实现文字的渐变色

效果

在这里插入图片描述

实现

  .text {
    position: absolute;
    left: 52px;
    top: 1px;
    width: 200px;
    height: 31px;
    font-family: YouSheBiaoTiHei;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 31px;
    text-shadow: 0px 0px 8px #000000;
    text-align: center;
    font-style: normal;
    transition: all 0.3s;
    cursor: pointer;
    &-active {
      // 渐变文字 从上到下
      background: linear-gradient(to bottom, #ffffff 50%, #1767c4 100%);
      background-clip: text;
      color: transparent;
      text-shadow: 0px 0px 100px rgba(0, 0, 0, 0.8);
    }
  }

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2024-03-14 15:32:04       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-14 15:32:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-14 15:32:04       20 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-14 15:32:04       20 阅读

热门阅读

  1. 代码即文档?

    2024-03-14 15:32:04       20 阅读
  2. 前端面试 ===> 【ES6】

    2024-03-14 15:32:04       18 阅读
  3. 突破编程_C++_设计模式(备忘录模式)

    2024-03-14 15:32:04       22 阅读
  4. 大带宽服务器租用 满足高速网络访问

    2024-03-14 15:32:04       22 阅读
  5. 服务器镜像是什么

    2024-03-14 15:32:04       20 阅读
  6. proxy和Object.defineProperty

    2024-03-14 15:32:04       22 阅读
  7. Linux 用户和用户组管理

    2024-03-14 15:32:04       17 阅读
  8. ubuntu22.04环境中安装pylint

    2024-03-14 15:32:04       17 阅读
  9. 高通qcm2290功耗问题

    2024-03-14 15:32:04       20 阅读
  10. 数据类型(面向对象)

    2024-03-14 15:32:04       17 阅读
  11. YOLOv8模型验证以及一些报错

    2024-03-14 15:32:04       17 阅读