Propriété CSS background-clip
Exemple
Spécifiez jusqu'où l'arrière-plan doit s'étendre dans un élément :
div
{
border: 10px dotted black;
padding: 15px;
background:
lightblue;
background-clip:
padding-box;
}
Définition et utilisation
La background-clip
propriété définit jusqu'où l'arrière-plan (couleur ou image) doit s'étendre dans un élément.
Valeur par défaut: | border-box |
---|---|
Hérité: | non |
Animable : | non. En savoir plus sur l'animation |
Version: | CSS3 |
Syntaxe JavaScript : | objet .style.backgroundClip="content-box" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Property | |||||
---|---|---|---|---|---|
background-clip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
Syntaxe CSS
background-clip: border-box|padding-box|content-box|initial|inherit;
Valeurs de propriété
Value | Description | Play it |
---|---|---|
border-box | Default value. The background extends behind the border | |
padding-box | The background extends to the inside edge of the border | |
content-box | The background extends to the edge of 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 |
Pages connexes
Tutoriel CSS : Arrière-plans CSS
Référence HTML DOM : propriété backgroundClip