๐ŸŒˆ

The Ultimate Guide to CSS Gradients โ€” With Free Generator

CSS gradients can transform flat designs into beautiful interfaces. Learn how to write them and use our free generator to create perfect gradients instantly.

CSS gradients are one of the most powerful yet misunderstood CSS features. This guide covers everything you need to know.

Types of CSS Gradients

Linear gradients flow in a straight line from one color to another:

background: linear-gradient(135deg, #7c6aff, #ff6b8a);

Radial gradients radiate outward from a center point:

background: radial-gradient(circle, #7c6aff, #0a0a0f);

Direction Values

  • to right โ€” left to right
  • to bottom โ€” top to bottom
  • 135deg โ€” diagonal
  • to bottom right โ€” corner to corner
  • Multi-Stop Gradients

    You can have more than two colors:

    background: linear-gradient(to right, #7c6aff, #ff6b8a, #3ddba6);

    Pro Tips

    Use subtle gradients for backgrounds (low opacity or similar hues) and bold gradients for buttons and highlights. Always check contrast ratios when using gradient backgrounds behind text.

    Use our free CSS Gradient Generator to create and copy gradients instantly.

    ๐ŸŒˆ

    Try it free: CSS Gradient Generator

    Create beautiful CSS gradients with live preview.

    Open CSS Gradient Generator โ†’