CSSeasyCSS

Gradient Text Effect

Apply beautiful gradient colors to text using CSS.

01

The problem

You want to create eye-catching text with gradient colors instead of solid colors.

02

The solution

CSS
.gradient-text {
  background: linear-gradient(135deg, #3a7bff, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated gradient text */
.animated-gradient-text {
  background: linear-gradient(
    90deg,
    #3a7bff, #8b5cf6, #ec4899, #3a7bff
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 3s ease infinite;
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

03

See it live

Isolated previewSandboxed
04

Put it to work

Example
<h1 class="gradient-text">
  Beautiful Gradient Heading
</h1>

<h2 class="animated-gradient-text">
  Animated Gradient Text
</h2>

Worth knowing

Works best on bold, large text. Add a fallback color for older browsers.