By default the retina style image should be at least 2x larger than the size that will be applied. In this case, it is 24px original but I do not know how to modify the css code to reflect the new dimensions so it pulls the correct icon from the 64px version while still displaying at 24px live.
At the moment it looks like you are using individual, inline images? That makes it easier. Just set the width and height to the desired dimensions in the CSS.
It’s harder to do this with background images. The only way is to create a container set to the width and height you want, and then use the background-size property. This only works in modern browsers, though.
Some devices now have “retina” screens (e.g. iPhone, iPad), which are much higher resolution than regular desktop screens. Thus, most images look a bit blurry and pixelated on these nice screens. So are lot of people are trying to find ways to make images crisper on these devices. One method is to make the image twice the required dimensions and then squeeze it down to the desired size, making it much sharper on screen.
Thanks. No, I’m not using inline images. I gave you the link to the sprite of the original background image used.
I do not know how to modify the CSS correctly to represent the new positioning of the larger, 64px sprite I made and reduce it down to 24px in the css code. This is where I’m stuck.
The example I looked at was using an inline image—the gray arrow one in the middle. Perhaps clarify which images you are talking about, as there are lots on the page.
The concern/focus here is the sprite links I posted. Not anything else. There’s the original 24px sprite and there’s my 64px version. I want to use the 64px (reduced down to 24px in the CSS code) for retina quality purpose. The 64px will replace the 24px sprite image file.
Where I’m confused is how to properly modify the CSS code to adjust the ‘positions’ of the icons in the 64px sprite.
Well, the problem is that you haven’t presented a practical example of this, because CSS and an image on their own are not enough. To give a specific answer that relates to your site, we need to see the HTML you are working with, as that’s critical. Anyhow, I’ll attempt a general answer.
Your only hope in this situation is to use a bit of CSS3, though that won’t work in older browsers, so beware. Your original CSS does the usual things of positioning the sprite as a background image on an HTML element. The difficulty now is that you want to scale the background image, which you can do with the CSS3 background-size property.
So, if you say had a div of width 24 x 24px, you would set the background image as usual, along with background position, but use background-size to resize the image to suit. Here’s a simple example with the image you provided:
If you want this to work on older browsers, you’ll perhaps need to serve up code like this in a media query, with fallback code for older browsers using the smaller image.