linear-gradient
Colors move along a direction or angle.
Gradients are CSS-generated images. Used well, they create depth, lighting and emphasis without needing heavy image files.
.surface {
background: radial-gradient(circle at 20% 0%, rgba(98,213,255,.2), transparent 34%);
}
Typography & Visual Style
A gradient is a background image generated by CSS. It can transition between colors in a line, from a center point or around a circle.
Gradients are powerful because they can create atmosphere and depth without extra image assets.
The risk is overuse. Strong gradients can look loud, dated or muddy. High-end CSS often uses gradients subtly as light, shadow or emphasis.
Colors move along a direction or angle.
Colors radiate from a center point. Great for light effects.
Colors rotate around a center. Useful for charts or special effects.
Precise positions control where transitions happen.
Visual model
Typography and visual style are where CSS starts to feel like design. These models turn subjective choices into reusable decisions you can explain, test and improve.
Examples
.surface {
background:
radial-gradient(circle at 20% 0%, rgba(98, 213, 255, .18), transparent 34%),
linear-gradient(135deg, #101827, #07111f);
}
.surface {
background: linear-gradient(90deg, purple, blue, red, orange, lime);
color: white;
}
Rules that matter
A beautiful one-off style is not enough. The goal is a visual system that keeps working when the site grows, content changes and new pages are added.
Subtle radial highlights often feel more premium than loud color bands.
Gradient backgrounds still need readable foreground text.
Multiple gentle layers can create depth without image files.
Some color pairs create unattractive middle colors.
Color stop positions control the shape of the effect.
Gradients can band or look different across displays.
Production thinking
Gradients can make flat surfaces feel designed, but they should support the layout instead of screaming over it.
Gradient contrast changes across the surface. Check the weakest contrast area, not only the best one.
Prefer reusable gradient tokens for brand surfaces and avoid one-off rainbow backgrounds.
Gradients have no direct SEO value, but polished readable visuals improve trust and engagement.
Live code lab
The preview runs in an isolated iframe. Links and forms stay inside the practice area, so you can experiment without leaving the lesson.
Mini assignment
Practice assignment
Try it yourself
Self-check
Answer these questions before moving on. If your answer is vague, change the lab values and judge the visual result again.
Senior audit upgrade
A gradient may have excellent contrast in one area and poor contrast in another. Check text against the weakest part.
Test the actual text position, not only the average gradient color.
Very subtle gradients can show banding after compression.
Gradients should support hierarchy, not become the entire design language.