CSS文字渐变效果

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gradient Text Example</title>
<style>
  body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
  }

  .gradient-text {
    font-size: 4rem;
    font-weight: bold;
    background-image: linear-gradient(45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* 使文字颜色透明,以显示背景 */
    /* animation: moveGradient 3s ease infinite; */
  }

  @keyframes moveGradient {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }
</style>
</head>
<body>

<h1 class="gradient-text">渐变文字效果</h1>

</body>
</html>
相关推荐
未来之窗软件服务35 分钟前
未来之窗昭和仙君(六十九)前端收银台行为异常检测—东方仙盟练气
前端·仙盟创梦ide·东方仙盟·昭和仙君
大叔编程奋斗记1 小时前
两个日期间的相隔年月计算
前端·salesforce
上海合宙LuatOS2 小时前
LuatOS核心库API——【io】 io操作(扩展)
java·服务器·前端·网络·单片机·嵌入式硬件·物联网
GISer_Jing3 小时前
Taro多端开发
前端·react.js·taro
未来龙皇小蓝3 小时前
RBAC前端架构-04:设置代理及开发配置
前端·vue.js
祈安_3 小时前
深入理解指针(一)
c语言·前端
SuperEugene3 小时前
对象数组的排序与分组:sort / localeCompare / 自定义 compare
前端·javascript·面试
扶苏10025 小时前
“解构”与“响应”的博弈——深入剖析 Vue 3 的 toRef 与 toRefs
前端·javascript·vue.js
icestone20005 小时前
使用Cursor开发大型项目的技巧
前端·人工智能·ai编程
Channing Lewis5 小时前
zoho crm的子表添加行时,有一个勾选字段,如何让它在details页面新建子表行(点击add row)时默认是勾选的
开发语言·前端·javascript