Style backgroundOrigine Propriété
Exemple
Positionnez l'image d'arrière-plan par rapport à la zone de contenu :
document.getElementById("myDIV").style.backgroundOrigin = "content-box";
Définition et utilisation
La propriété backgroundOrigin définit ou renvoie ce à quoi la propriété background-position est relative.
Remarque : Si la propriété background-attachment de l'image d'arrière-plan est "fixe", cette propriété n'a aucun effet.
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 | |||||
---|---|---|---|---|---|
backgroundOrigin | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
Syntaxe
Renvoyez la propriété backgroundOrigin :
object.style.backgroundOrigin
Définissez la propriété backgroundOrigin :
object.style.backgroundOrigin = "padding-box|border-box|content-box|initial|inherit"
Valeurs de propriété
Value | Description |
---|---|
padding-box | Default value. The background image is positioned relative to the padding box |
border-box | The background image is positioned relative to the border box |
content-box | The background image is positioned relative 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 |
Détails techniques
Valeur par défaut: | boîte de rembourrage |
---|---|
Valeur de retour : | Une chaîne, représentant la propriété background-origin d'un élément |
Version CSS | CSS3 |
Pages connexes
Référence CSS : propriété background-origin