Style backgroundClip Property

Example

Specify the painting area of the background:

document.getElementById("myDIV").style.backgroundClip = "content-box";
Try it Yourself »

Description

The backgroundClip property sets or returns the painting area of the background.

See Also:

HTML Styles: The background Property

CSS Tutorial: CSS Backgrounds

CSS3 Tutorial: CSS3 Backgrounds

CSS Reference: The background-clip 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 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

Browser Support

backgroundClip is a CSS3 (1999) feature.

It is fully supported in all browsers:

Chrome Edge Firefox Safari Opera IE
Yes Yes Yes Yes Yes 11


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.