CSS Attachement de Fond


CSS background-attachment

La propriété background-attachment spécifie si l'image de fond doit défiler ou rester fixe (ne défilera pas avec le reste de la page) :

Exemple

Spécifiez que l'image de fond doit rester fixe :

body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: fixed;
}
Essayez-le vous-même »

Exemple

Spécifiez que l'image de fond doit défiler avec le reste de la page :

body {
background-image: url("img_tree.png");
background-repeat: no-repeat;
background-position: right top;
background-attachment: scroll;
}
Essayez-le vous-même »


La Propriété CSS Background Attachment

Propriété Description
background-attachment Définit si une image de fond est fixe ou défile avec le reste de la page

Vidéo : Attachement de Fond CSS