On this page
  1. linear-gradient()
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

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

Example

.hero {
  background-image: linear-gradient(135deg in oklch, oklch(55% 0.2 260), oklch(68% 0.18 190));
}

Linked from

Related notes