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 background-clip property sets or returns the painting area of the background.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The backgroundClip property is supported in Internet Explorer 9+, Firefox, Opera, Chrome, and Safari.

Note: The backgroundClip property is not supported in Internet Explorer 8 and earlier versions.


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

Color Picker

colorpicker