guide

How to Create CSS Gradient Text Free — Generator (2026)

By Rui Barreira · Last updated: 18 June 2026

You can generate CSS gradient text with a live preview using brevio Gradient Text CSS Generator — the CSS is generated in your browser with no upload required.

How to Create Gradient Text in CSS

Gradient text in CSS uses a three-property technique: apply a gradient as a background on the text element, clip the background to the text shape, and make the text fill transparent so the background shows through.

.gradient-text {
  background: linear-gradient(90deg, #ff6b6b 0%, #4ecdc4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Firefox fallback */
  color: #ff6b6b;
}

How Each Property Works

  • background. Sets the gradient as the element's background. This can be any valid CSS gradient: linear-gradient, radial-gradient, or conic-gradient.
  • -webkit-background-clip: text. Clips the background to the shape of the text characters. The -webkit- prefix is required for Chrome and Safari even in 2024.
  • -webkit-text-fill-color: transparent. Makes the text fill color transparent so the background shows through the character shapes. This is distinct from color: transparent — it affects only the fill, not the stroke.
  • background-clip: text. The unprefixed version for standards compliance. Use both prefixed and unprefixed versions together.
  • color: <first-stop-color>. Firefox fallback (see below).

Browser Support

The -webkit-background-clip: text technique works in all modern Chromium-based browsers (Chrome, Edge, Brave, Arc) and Safari. Firefox does not support -webkit-background-clip: text and silently ignores it, displaying the element's color value instead. This means Firefox users see a flat color rather than the gradient — acceptable as a fallback for most use cases.

Firefox Fallback Strategy

Set color to the first (or most representative) color in your gradient. This ensures Firefox users see text in a recognisable color rather than invisible text (which would happen if color: transparent were applied). The CSS cascade means the color property applies in Firefox (where -webkit-text-fill-color is ignored) and is overridden by -webkit-text-fill-color: transparent in browsers that support the gradient technique.

Gradient Types

  • Linear gradient. Color transitions along a straight line at a specified angle. 90deg goes left to right; 45deg goes diagonally from bottom-left to top-right.
  • Radial gradient. Color transitions outward from a center point. Creates a glow effect on text where the center is one color and the edges fade to another.
  • Conic gradient. Color transitions around a center point (like a color wheel). Creates rainbow or angular sweep effects. Supported in modern browsers.

Accessibility Considerations

Gradient text can reduce readability, especially when the gradient transitions through low-contrast hues relative to the background. Avoid gradients that pass through a hue with insufficient contrast against the page background at any point in the transition. Screen readers read the text content regardless of styling, so gradient text does not affect screen reader accessibility. However, very low-contrast gradient text can make content illegible for users with visual impairments — always verify the minimum contrast at the lightest point of the gradient.

Common Design Patterns

  • Hero headings. Large display text (36px+) benefits most from gradient effects because the gradient has more surface area to show through the characters.
  • Brand names. A gradient on a company name in a header creates visual interest without adding imagery.
  • CTA emphasis. A gradient on a single key word in a heading draws attention to it.
  • Dark backgrounds. Gradient text works particularly well on dark or black backgrounds because the gradient colors are more vivid against dark surfaces.

Performance Note

Gradient text involves background compositing, which is more GPU-intensive than plain text rendering. For body text or large blocks of text, avoid gradient fills — they increase paint complexity and can reduce scrolling performance on low-end devices. Reserve gradient text for short display strings of 1–5 words.

Frequently Asked Questions

What CSS properties create gradient text?
Three properties work together: background sets the gradient, -webkit-background-clip: text clips the background to the text shape, and -webkit-text-fill-color: transparent makes the text fill transparent so the gradient shows through.
Does gradient text work in all browsers?
It works in all Chromium-based browsers (Chrome, Edge, Brave, Arc) and Safari. Firefox does not support -webkit-background-clip: text and displays the color property as a fallback instead. Set color to the first gradient color as a Firefox fallback.
What are the performance implications?
Gradient text involves background compositing, which is more GPU-intensive than plain text rendering. For body text or large blocks of text, avoid gradient fills. Reserve gradient text for short display strings of 1–5 words.
More free toolsSee all 469
Merge PDFsCompress ImageJSON FormatterPassword GeneratorVAT CalculatorQR Code Generator
How to Create CSS Gradient Text Free — Generator (2026) | brevio