CSS:mon background défilant ne fonctionne pas.Aidez moi svp.
LamaGracieux40
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
bg62 Messages postés 23433 Date d'inscription Statut Modérateur Dernière intervention -
bg62 Messages postés 23433 Date d'inscription Statut Modérateur Dernière intervention -
Bonjour,
mon background défilant en CSS ne fonctionne pas malgré mes nombreux essais pouvez vous m'aidez s'il vous plait.
Voici le code:
body{
background-image: url(pogacar.png);
background-size: 100%;
margin: 0;
padding: 0;
background-attachment: scroll;
}
Windows / Firefox 138.0
2 réponses
-
Bonjour,
Je ne suis pas sur de comprendre ce que vous voulez faire juste avec ce bout de code.
En l'état si ça ne défile pas, c'est parce qu'il n'y a pas de contenu. L'image prend tout l'écran et c'est tout, il n'y a rien à défiler sur le premier plan.
-
bonsoir ...
pas évident de répondre avec si peu de détails ... :)
ici tu as des exemples de codages multiples pour des animations :
https://developer.mozilla.org/fr/docs/Web/CSS/Reference/Properties/animation-timing-function
par exemple :
<!DOCTYPE html> <html lang="fr"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style> @keyframes defile { 0% { background-position-x: 0; } 100% { background-position-x: 100vw; } } body, .bkg { margin: 0; padding: 0; } .bkg { height: 100vh; background: url('http://urlz.fr/7Sga'); -webkit-background-size: cover; background-size: cover; background-color: #fbff25; animation: defile 20s linear infinite; } </style> </head><body> <div class="bkg"> </div> </body></html>