property

background-image — CSS reference

Supplies decorative images behind the element content. Initial none, not inherited. Gradients are generated images; URL images may fail to load. The first listed image is closest to the viewer. Supply a background color for contrast and do not hide essential information in a CSS image.

Formal Syntax & Structure

css syntaxcss
<image># | none (each layer accepts none)

Working 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,red);background-size:50px 80px,100% 100%;background-repeat:no-repeat;background-image:linear-gradient(red,red), linear-gradient(blue,blue)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative background sample.</p></body></html>
CSS Reference