Style backgroundClip attribute
- Previous Page backgroundRepeat
- Next Page backgroundOrigin
- Go to the Previous Level HTML DOM Style Object
Definition and usage
backgroundClip
Sets or returns the drawing area of the background attribute.
See also:
HTML Styles:background property
CSS Tutorial:CSS Background
CSS3 Tutorial:CSS3 Background
CSS Reference Manual:background-clip property
Example
Specify the drawing area of the background:
document.getElementById("myDIV").style.backgroundClip = "content-box";
Syntax
Return the backgroundClip property:
object.style.backgroundClip
Set the backgroundClip property:
object.style.backgroundClip = "border-box|padding-box|content-box|initial|inherit"
Attribute value
Value | Description |
---|---|
border-box | Default value. The background is clipped to the border box (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 that represents the background-clip property. |
CSS version: | CSS3 |
Browser support
backgroundClip
It is a CSS3 (1999) feature.
All browsers fully support it:
Chrome | Edge | Firefox | Safari | Opera | IE |
---|---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera | IE |
Support | Support | Support | Support | Support | 11 |
- Previous Page backgroundRepeat
- Next Page backgroundOrigin
- Go to the Previous Level HTML DOM Style Object