On this page
linear-gradient()
Prev: `light-dark()` | Up: color | Next: at_rules
Rel: color, Color & Value Functions Guide
Ref: MDN Web Docs — linear-gradient()
Tags: #public #web #css #functions #color #tier/standard
Syntax & Overview
linear-gradient(135deg, #2563eb, #7c3aed)
Generates a smooth gradient <image> usable in background-image.
Notes & Best Practices
- Add
in oklchfor smoother color transitions without washed-out midpoints. - Gradients are
<image>values: Apply viabackground-image(notbackground-color).
Example
.hero {
background-image: linear-gradient(135deg in oklch, oklch(55% 0.2 260), oklch(68% 0.18 190));
}
Linked from
Related notes
- tuts/css/functions/color/light-dark Linked here; links to this page; shared tags: #color, #css, #functions, #tier, #web
- tuts/css/functions/color Linked here; links to this page; shared tags: #color, #css, #functions, #web
- tuts/css/functions/color_and_value_functions Linked here; shared tags: #color, #css, #functions, #web
- tuts/css/at_rules Linked here; shared tags: #css, #web
- tuts/css/functions/color/color-mix shared tags: #color, #css, #functions, #tier, #web
- tuts/css/functions/color/oklch shared tags: #color, #css, #functions, #tier, #web
- tuts/css/functions/color/var shared tags: #color, #css, #functions, #tier, #web
- tuts/css/functions/math/calc shared tags: #css, #functions, #tier, #web
- tuts/css/functions/math/clamp shared tags: #css, #functions, #tier, #web
- tuts/css/functions/math/min shared tags: #css, #functions, #tier, #web