Paraphrased question from email:
I just read your article Responsive Images: If you’re just changing resolutions, use srcset. In the age of "responsive websites,"
srcsetdoes not help in certain situations. For example, I have a popular products slider. On mobile, I have one image per slide where the images are 320px wide. On desktop, I have six images per slide where each is 160px wide. So the desktop images are smaller on desktop, not bigger.
How do I handle this situation with
I tried to be careful with that post title: "If you’re just changing resolutions, use srcset." In this case, we're changing the size of the images not just at certain resolutions, but at specific breakpoints as well, which means we're also going to need to use the
sizes attribute to get the most out of responsive images. The entire job of the
sizes attribute is to tell the browser what size the image will be shown at, as per our CSS.