Latest web development tutorials

HTML DOM Style backgroundClip property

Style Object Reference Style Objects

Examples

Specifies the drawing area background:

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

try it"

Definition and Usage

background-clip property sets or returns the background of the drawing area.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

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


grammar

Back backgroundClip properties:

object .style.backgroundClip

Setting backgroundClip properties:

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

Property Value

描述
border-box 默认值。背景按边界框进行剪裁。
padding-box 背景按填充框进行剪裁。
content-box 背景按内容框进行剪裁。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: border-box
return value: String representing the background-clip property element.
CSS version CSS3


related articles

CSS Reference Manual: background-Clip property


Style Object Reference Style Objects