I can do
background: url(/images/sprites.png) no-repeat 0 -22px;
or
background: url(/images/sprites.png) no-repeat top center;
What if I want to place my sprite on top开发者_运维百科 center? Like:
background: url(/images/sprites.png) no-repeat 0 -22px top center;
UPD
I have got a block with dynamic width. I want to put in its top center
my image, that is part of sprite.
You can either use keywords such as top center
, or explicit values such as 0 -22px
.
There is no way to use both at the same time.
(you can of course use one of each, for example -22px top
)
background: url(/images/sprites.png) no-repeat 0 -22px top center;
This is invalid.
top center is the same as 50% 0;
Can you describe what do you want exactly?
精彩评论