If I have a 1000×3000 px image and I use a negative background position, how does this exactly work?
I thought it worked by moving to the left 209 pixels then moving up 2 pixels and then showing the part that actually is left, but it seems to do the opposite of that.
Background position property actually moves the background image itself relative to the element. For the instance if you use
{background-position: 0 0}that means you are positioning(0,0)which is top left of your image to the top left of your html element.The
-ve left offsetmeans you are moving the image towards left and the-ve top offsetmeans moving the image upwards..In above code first
0refers toleft offsetand second0refers to thetop offset..means you are moving your image 209px towards left and 2px upwards.
Hope this will help you.