Example

Specify the painting area of the background image:

div
{
background:url(/images/w3css.gif);
background-repeat: no-repeat;
background-size: 100% 100%;
background-clip: content-box;
-webkit-background-clip: content-box; /* Safari and Chrome */
}

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The background-clip property is only supported in Opera.

Safari and Chrome support an alternative, the -webkit-background-size property.


Definition and Usage

The background-clip property specifies the painting area of the background images.

Default value: border-box
Inherited: no
Version: CSS3
JavaScript syntax: object.style.backgroundClip="content-box"


Syntax

background-clip: padding-box|border-box|content-box;