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>
相关推荐
林恒smileZAZ18 小时前
Vue<前端页面版本检测>
前端·javascript·vue.js
码事漫谈21 小时前
当AI开始“思考”:我们是否真的准备好了?
前端·后端
许杰小刀1 天前
ctfshow-web文件包含(web78-web86)
android·前端·android studio
我是Superman丶1 天前
Element UI 表格某行突出悬浮效果
前端·javascript·vue.js
恋猫de小郭1 天前
你的代理归我了:AI 大模型恶意中间人攻击,钱包都被转走了
前端·人工智能·ai编程
xiaokuangren_1 天前
前端css颜色
前端·css
Huanzhi_Lin1 天前
关于V8/MajorGC/MinorGC——性能优化
javascript·性能优化·ts·js·v8·新生代·老生代
hoiii1871 天前
C# 基于 LumiSoft 实现 SIP 客户端方案
前端·c#
anOnion1 天前
构建无障碍组件之Meter Pattern
前端·html·交互设计
小码哥_常1 天前
Spring Boot配置diff:解锁配置管理新姿势
前端