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 Responsive Images Image Delivery with Srcset and Sizes Using Srcset

Does order matter here? srcset="photo-@2x.jpg 2x, photo@-1x.jpg 1x" vs. srcset="photo-@1x.jpg 1x, photo-@2x.jpg 2x"

Does it matter whether you list the larger resolution photo first before the smaller resolution?

4 Answers

Blaize Pennington
Blaize Pennington
13,878 Points

According to Mozilla.org not only does the order not seem to matter, but the 1x picture can be used as your src element and your 2x as your srcset. You don't need to type it twice.

Nick says you need to put the larger picture first, like you have it, but whether you ABSOLUTELY MUST do it, or it won't work, I don't know. Hope that helps! :)

btw Maureen O'Neal if you comment on this question the guy that post this... will not receive a notification

Maureen O'Neal
Maureen O'Neal
12,930 Points

Nick says you need to put the larger picture first, like you have it, but whether you ABSOLUTELY MUST do it, or it won't work, I don't know. Hope that helps! :)

Your welcome :)