Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Displaying @2x image within a media query on Wordpress

I'm having trouble getting my Wordpress blog to load an @2x image when viewed on my iPhone. I'm working to make my blog responsive, and it works well in a desktop browser. The problem is when I view it on my iPhone, it doesn't seem to be loading the @2x image. I'm not sure what I'm doing wrong here. Is there something about Wordpress that I'm missing?

Here is the code, which is sitting inside of a media query.

@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (max--moz-device-pixel-ratio: 2) {

div#logo a#name {
    background-size: 280px 27px;
    background: url("http://samuelhermes.com/images/logo_small@2x.png") 0 0 no-repeat;
}
}

My blog's address is http://samuelhermes.com/blog.

1 Answer

Matthew Mascioni
Matthew Mascioni
20,444 Points

I took a look. Your CSS looks good and the image looks intact. (although I'm no CSS expert)

You can use something like Retina.js to serve retina images a little easier.

However, in viewing it on my retina iPad, the logo seems to be pretty retina-y to me!