# Background Position Percentage
When writing css, you may find that when set the value of the `background-position` using percentage value,it may look different from what you position a picture using `left` or `top`.You can find an example [here](https://css-tricks.com/i-like-how-percentage-background-position-works/).
If we are setting a sprite picture as backgroud, we may style like below:
``` css
div {
overflow: hidden,
background: url(some.pic) center 50% no-repeat
}
```
Then `div` will show the middle of `some.pic`, not set the middle of `some.pic` as its top. We can guess how to calculate that:
``` math
top = percent * (div_height - pic_height)
```
What I talk about above is a problem may encounter when use sprite.
Assuming that sprite is vertical, seprated as `n` part, we want to show the `m`th(start from 0) part of it, with its heght is height of contaner, width auto. Our css may like below:
``` css
div {
overflow: hidden,
background: url(some.pic) center (100*(m/n-1))%/auto (100*n)% no-repeat
}
```