Gradients: Linear and Radial
Create smooth color transitions with linear-gradient() and radial-gradient().
Gradients: Linear and Radial is a free CSS Academy lesson on CoddyKit. This is lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the CSS Academy learning path, and your progress syncs across the web and the CoddyKit app. The CSS Academy course includes 4 lessons in total.
What is a CSS Gradient?
CSS gradients are generated images (no image file needed) that transition between two or more colors. They are specified as values of background-image or the background shorthand.
linear-gradient() Basics
A linear gradient transitions colors along a straight line. The first argument sets the direction, followed by color stops.
<div class="gradient-demo"></div>
Gradient Direction: Keywords and Angles
Direction can use keywords or degree angles:
<div class="dir-keyword"></div>
<div class="dir-45deg"></div>
<div class="dir-135deg"></div>
Multiple Color Stops
Add as many color stops as needed. Each stop can optionally specify a position (length or percentage).
<div class="stops"></div>
Hard Color Stops
Set two stops at the same position to create a hard stop — an abrupt color change with no blend.
<div class="hard-stop"></div>
Repeating Linear Gradient
repeating-linear-gradient() tiles the gradient pattern to create stripes and textures.
<div class="stripes"></div>
radial-gradient() Basics
A radial gradient radiates outward from a center point in an elliptical or circular shape.
<div class="radial-demo"></div>
Radial Shape and Size
Control the gradient shape (circle or ellipse) and its extent keyword:
<div class="radial-circle"></div>
<div class="radial-ellipse"></div>
Radial Gradient Position
Use at <position> after the shape/size to move the center of the radial gradient.
<div class="radial-position"></div>
Conic Gradient
conic-gradient() sweeps colors around a center point like a pie chart. It requires the from start angle and optional at position.
<div class="conic-demo"></div>
Gradient Transparency
Use transparent or rgba() in gradient stops to fade in or out smoothly from an element's background color.
<div class="fade-overlay"></div>
Quick Check
Which CSS function generates a gradient that radiates outward from a center point?
Recap
Linear gradients go along a line, radial gradients radiate outward, and conic gradients sweep around a point. Use hard stops for stripes. All gradient functions are background-image values and generate images without external files.
Learn CSS with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 40
- Lessons
- 159
Frequently Asked Questions
Is the “Gradients: Linear and Radial” lesson free?
Yes — the full text of “Gradients: Linear and Radial” is free to read here on the web. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the CSS Academy course, upgrade to CoddyKit PRO. The CSS Academy course includes 4 lessons in total.
What will I learn in “Gradients: Linear and Radial”?
Create smooth color transitions with linear-gradient() and radial-gradient(). You practise CSS Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start CSS Academy?
No prior experience is required. CSS Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 3 of 4.
How long does the “Gradients: Linear and Radial” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this CSS Academy lesson?
Yes. Every CSS Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Color Values: Named, Hex, RGB, HSL
- Background Color and Image
- Gradients: Linear and Radial
- Opacity and RGBA Transparency