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

HTML

Where's the problem? <HTML><Responsive>

The <img> element inside <div class="profile-image">, has a @1x image inside the srcset attribute. Modify the srcset attribute so that the @2x image photo-@2x.jpg comes first, and the @1x image that's already present comes second.

Why isn't correct this response? <div class="profile-image"> <img srcset="photo-@2x.jpg @1x" src="photo-@2x.jpg" alt="Photograph of a flower." /> </div>

3 Answers

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

Line 31 needs to be modified to include the 2x asked by the task.

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

Good! I'm sorry, but It's Monday! :-) ;-)

Steven Parker
Steven Parker
243,656 Points

You forgot to include a link to the challenge, but it looks like you no longer have the filename of the 1x image in any of the img tag attributes. The description makes it sound like the task would be to add another source to one that was already in the srcset.

Can you write the correct code, please?

Link to challenge is missing so a correct answer can't be given unless they know what challenge it is.