🎨CSS & Color

Linear Gradient Backgrounds

Vibrant background gradients for cards and hero sections.

Explanation

Gradients add depth and visual interest to flat designs.

Examples

Sunset
Output
linear-gradient(to right, #f87171, #facc15)
Ocean
Output
linear-gradient(to bottom right, #3b82f6, #2dd4bf)

Code Examples

CSS
.hero-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

Try it Now

💡 Tips

  • Use 135deg for a natural diagonal look
  • Ensure text contrast is high enough over the gradient
  • Subtle gradients (close hues) look more modern

⚠️ Common Pitfalls

  • Avoid "muddy" centers by using hues that are close on the color wheel