YouTip LogoYouTip

Prop Style Backgroundclip

HTML DOM Style backgroundClip Property

HTML DOM Style backgroundClip Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference Manual

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

<source>

HTML DOM Table Object

Style backgroundClip Property

Style Object Reference Manual Style Object

Example

Specify the background drawing area:

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

Try it yourself Β»


Definition and Usage

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The backgroundClip property is supported in Internet Explorer 9+, Firefox, Opera, Chrome, and Safari.

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. Background is clipped to the border box.
padding-box Background is clipped to the padding box.
content-box 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 background-clip property of an element.
CSS Version: CSS3

Related Articles

CSS Reference: background-clip property


Style Object Reference Manual Style Object

ByteDance Coding Plan supports mainstream large models such as Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., officially supplied, stable and reliable. Configuration Guide Β₯9.9/month Subscribe Now

← Prop Style BackgroundoriginCss Inherit β†’