Placing an image from the sprite in the specific position

Let's say i have a sprite with lots of icons. I want to place one of the icons in the specific position over the div, e.g. 15px from the right side and 20px from the top. Previously, when i had single image file i used the following code:

background: white url(./imgs/some/icon.png) no-repeat 91% 47%;

Now then the image is in the sprite i can access it using

background-position: 0 -471px;

But as i see it there is no place to add my current 91% 47%. Is there some kind of workaround? It's possible to use CSS3 in the project if it helps.

Thanks!

Answers


Would you be able to add another <div>, give it the correct background, and absolute position it where it needs to be? I'm thinking that your background-position percentages are probably out when you use a sprite sheet.


Need Your Help

why dropdownlist in mvc4 throws error where mvc3 work well

asp.net-mvc-3 asp.net-mvc-4 html-select

Could you tell me please does MVC4 has different dropdownlist then mvc3?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.