Gradients

๐ŸŽจ CSS3+ ๐ŸŸข Chapter 31 of 49 ๐Ÿ“‚ Phase 11: Backgrounds & Visual Effects ๐Ÿ“… 2026 Edition
๐Ÿ“Œ Covered in this chapter: Linear Gradient ยท Direction ยท Color Stops ยท Radial ยท Conic ยท Gradient Backgrounds ยท Gradient Borders ยท Gradient Text ยท Overlays ยท Performance
Welcome to Chapter 31: Gradients โ€” part of the CSS Complete Roadmap. This lesson covers all subtopics with clear explanations, code examples, and best practices used in professional web development.
1Linear & Radial Gradients
.gradient-bg {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

.radial-bg {
  background: radial-gradient(circle at top left, #eff6ff, #dbeafe);
}

.conic-badge {
  background: conic-gradient(from 180deg, #2563eb, #7c3aed, #2563eb);
}

Color stops: linear-gradient(to right, red 0%, yellow 50%, green 100%)

2Gradient Borders, Text & Performance
CSS
.gradient-text {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gradient-border {
  border: 2px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box,
              linear-gradient(135deg, #2563eb, #7c3aed) border-box;
}

Performance: CSS gradients GPU-friendly โ€” large image backgrounds kante often faster. Complex animated gradients CPU use cheyochu.

OC
Written by Our Compiler Technical Editorial Team
Reviewed for accuracy ยท CSS Complete Roadmap ยท Last updated August 2026