data-type
<gradient> — CSS reference
A generated image with color stops and an interpolation method. It has no natural dimensions or aspect ratio; the consumer supplies a concrete size. Use a gradient in image-valued properties, not directly in color-only properties.
Formal Syntax & Structure
css syntaxcss
<linear-gradient()> | <radial-gradient()> | <conic-gradient()> | their repeating formsWorking Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS image painting lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{width:100px;height:80px;background-color:blue}#a{background-image:linear-gradient(red, blue)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative background sample.</p></body></html>