Définit les détails supplémentaires que l'utilisateur peut afficher ou cacher
La propriété background-position-x définit la position d'une image d'arrière-plan sur l'axe des x. La propriété background-position-y définit la position d'une image d'arrière-plan sur l'axe des y.
background-position-x : valeur ; background-position-y : valeur ;
Valeurs par défaut | 0% |
---|---|
Inherited: | non |
Animable : | oui En savoir plus sur l'animable |
Version: | CSS3 |
Syntaxe JavaScript: | object.style.backgroundPositionX="center" object.style.backgroundPositionY="center" |
Explorateur | ![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|---|
Verssion | 43 4 -webkit- | 10 | 16 5 -moz- | 9 4 -webkit- | 30 15 -webkit- 12 -o- |
Exemple Copier le code
<!DOCTYPE html> <html lang="fr"> <head> <meta charset="UTF-8"> <html lang="fr"> <head> <meta charset="UTF-8"> <title>CSS background-position-y Property</title> <style> body { background-position: center; text-align: center; background-image: url(" https://www.oujood.com/propriete-css/images/CSSTutoriel.png"); background-size: 500px; background-repeat: no-repeat; background-attachment: fixed; background-position-y: center; background-position-x: left; } h1 { color: green; } img { width: 100px; height: 100px; } </style> </head> <body> <h1>www.oujood.com</h1> <h3> Propriétés CSS background-position-y et background-position-x </h3> </body> </html>