W3Schools.com
THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPJQUERYBOOTSTRAPANGULARXML
 

Style backgroundClip Property

Style Object Reference Style Object

Example

Specify the painting area of the background:

document.getElementById("myDIV").style.backgroundClip = "content-box";

Try it yourself »

Definition and Usage

The backgroundClip property sets or returns the painting area of the background.


Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
backgroundClip 4.0 9.0 4.0 3.0 10.5

Syntax

Return the backgroundClip property:

object.style.backgroundClip

Set the backgroundClip property:

object.style.backgroundClip="border-box|padding-box|content-box|initial|inherit"

Property Values

Value Description
border-box Default value. The background is clipped to the border box
padding-box The background is clipped to the padding box
content-box The background is clipped to the content box
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: border-box
Return Value: A String, representing the background-clip property of an element
CSS Version CSS3

Related Pages

CSS reference: background-clip property


Style Object Reference Style Object