HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Specify how far the background should extend within an element
The background-clip
property defines how far the background (color or image)
should extend within an element.
Default value: | border-box |
---|---|
Inherited: | no |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.backgroundClip="content-box" Try it |
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
background-clip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
Value | Description | Demo |
---|---|---|
border-box | Default value. The background extends behind the border | Demo ❯ |
padding-box | The background extends to the inside edge of the border | Demo ❯ |
content-box | The background extends to the edge of the content box | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
CSS tutorial: CSS Backgrounds
HTML DOM reference: backgroundClip property