background-position: 25% 75%means the blemish on the image that is 25 % from the left and 75 % from the top will be placed at the spot of the container that is 25 % from the container ‘s leave and 75 % from the container ‘s exceed.
basically what happens is the setting visualize dimension is subtracted from the equate container dimension, and then a share of the resulting value is used as the direct offset from the leave ( or top ) edge.
(container width - image width) * (position x%) = (x offset value) (container height - image height) * (position y%) = (y offset value)
Using the X axis for an example, let ‘s say we have an visualize that is 300px wide and we are using it in a container that is 100px wide, with background-size rig to car :
Read more: How to Embed a Google Form: Flickroom
100px - 300px = -200px (container & image difference)
so that with placement percentages of -25 %, 0 %, 50 %, 100 %, 125 %, we get these image-to-container edge set-back values :
-200px * -25% = 50px -200px * 0% = 0px -200px * 50% = -100px -200px * 100% = -200px -200px * 125% = -250px
therefore with these vector sum values for our exercise, the left edge of the image is offset from the left edge of the container by :
- + 50px (putting the left image edge in the center of the 100-pixel-wide container)
- 0px (left image edge coincident with the left container edge)
- -100px (left image edge 100px to the left of the container, in this example that means the middle 100px image area is centered in the container)
- -200px (left image edge 200px to the left of the container, in this example that means the right image edge is coincident with the right container edge)
- -250px (left image edge 250px to the left of the container, in this example that puts the right edge of the 300px-wide image in the center of the container)
It ‘s worth mentioning that if your background-size is peer to the container size for a given axis, then a share position for that axis will have no consequence because the “ container-image deviation ” will be zero. You will need to offset using absolute values .