concept

Background painting area — CSS reference

The painting area clips the background to the box chosen by background-clip. Rounded corners can further clip it; the image origin can be elsewhere. The background color is clipped using the bottommost layer clip.

Formal Syntax & Structure

css syntaxcss
See related property or function grammar.

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{padding:10px;border:5px solid transparent;background-clip:content-box;background-image:linear-gradient(red,red)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative background sample.</p></body></html>
CSS Reference