concept

Background positioning area — CSS reference

The rectangle for resolving background-size and background-position is normally determined by background-origin. It is distinct from the region in which the image is allowed to paint. With fixed attachment it is the initial containing block, subject to other applicable specifications.

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