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! While you're at it, check out some resources Treehouse students have shared here.

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


hi am having trouble placing a second image first code challenge please help

<div class=".profile-image"> <img srcset="img/photo-@2x.jpg 2x, img/photo-@1x.jpg 1x" src="photo-@1x.jpg" alt="Photograph of a flower." /> </div> what did i miss

4 Answers

Hi Vincent,

It's always a good idea to have a link to the code challenge you're asking about so others can review it.

If you use the "Get Help" button on the challenge page then your question will automatically be linked to the the challenge.

This is the challenge I think you're on: http://teamtreehouse.com/library/responsive-images/image-delivery-with-srcset-and-sizes/using-srcset-2

You have added an "img" sub-folder path to your images which wasn't there in the starter code.

<div class="profile-image">
              srcset="photo-@1x.jpg 1x"
              alt="Photograph of a flower."

The way that you have added your 2nd image is correct but you need to remove the "img" sub-folder from both of your image paths. The images are in the same location as the html file.

Luciano Bruzzoni
Luciano Bruzzoni
15,518 Points

Did you try putting the src first and then the srcset? all I can think of.

          srcset="img/photo-@2x.jpg 2x,
                      img/photo-@1x.jpg 1x"
         alt="Photograph of a flower."/>
Mark Buckingham
Mark Buckingham
5,574 Points


it may be a browser compatibility issue, srcset is new to html5 and not supported on all browsers.

See http://caniuse.com/#search=srcset


Ryan Field
Ryan Field
Courses Plus Student 21,242 Points

Which code challenge is this, specifically? It would help if I could see what you're trying to do.


"Using Srcset" coding challenge in that course. I just entered what I thought the answer was and got a Bummer message .... I didn't change anything and submitted the same answer a few times and eventually it just went through to the next video and gave me the tick. (strange)