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 rightto bottom โ top to bottom135deg โ diagonalto bottom right โ corner to cornerMulti-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.