+ 1
Background image CSS
Why isn't my image starting from the top? Seeing vertically, my image is starting from the middle. Why's that happening and how to avoid it? https://code.sololearn.com/WA75rW12je4G/?ref=app
6 ответов
+ 1
remove the background-position property
+ 2
Because the height of the image is less than the page height, so the image is repeated to cover all the page
+ 2
Gordon yeah it's working, tnx. Can you help me to centre it horizontally, but stay the same vertically?
+ 2
Gordon thank you very much =)
+ 1
Muhammad yeah I know that. My question is why my image is starting to repeat from middle? It should've started to repeat from the top right? In other words, the girl's face should've been visible before her hand
+ 1
background-position: 50% 0%;
first percentage is horizontal
second percentage is vertical
https://code.sololearn.com/WDXq9AHAezWa/?ref=app
Another combination: center top
https://code.sololearn.com/Wz7lwtxVf3Gn/?ref=app