Srcset code for responsive images in Squiz

(Stef) #1

What is the correct way of rewriting srcset code in Squiz to display images in different screen sizes?
Can I replace the image name with asset number?

lgbtiq flags

I tried this below to place the image location but doesn’t seem to work…

<img src="./?a=1254851" alt="lgbtiq flags" srcset="./?a=1254853 600w, ./?a=1254855 800w, ./?a=1254858 1200w, bannerLGBTIQ.jpg 1600w" />


(Michael Wilson) #2

Hi Stef,

Try the HTML 5 way:

Or you can make a single image responsive:

Both will work in Matrix with asset IDs.