Style backgroundClipProperty

Style 对象参考手册Style Object

Examples

Specify the drawing 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 drawing 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"

Property Values

Value Description
border-box Default value. The background is clipped according to the border box.
padding-box The background is clipped according to the padding box.
content-box The background is clipped according to the content box.
initial Sets this property to its default value. Please refer to.initial。
inherit Inherits this property from its parent element. Please refer to.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:background-clip Property


Style 对象参考手册Style Object

Other Extensions