Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style backgroundClip property

Style backgroundClip property

Style Object Reference The Style object

Example

Specify the painting area of the background:

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

Try it »


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

Internet Explorer 9+, Firefox, Opera, Chrome, and Safari support the backgroundClip property.

**Note:** Internet Explorer 8 and earlier versions do not support the backgroundClip property.


Syntax

Return the backgroundClip property:

object

.style.backgroundClip

Set the backgroundClip property:

object

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

Attribute 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. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: border-box
Return Value: A string representing the element's background-clip property.
CSS version CSS3

Related Articles

CSS Reference Manual:The background-clip property


Style Object Reference The Style object