data-type
<image> — CSS reference
An image-valued CSS type can refer to a resource or a generated image. The layout or painting context determines its concrete size. Invalid resources and syntactically invalid declarations are distinct: a failed load need not trigger a previous declaration.
Formal Syntax & Structure
css syntaxcss
<url> | <gradient> | image() | image-set() | cross-fade() | element() (draft inventory)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, blue)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative background sample.</p></body></html>