Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Please explain how to correctly display an image with the "sizes" and "srcset" attributes. How they should change and how to display them correctly. For example, I display a logo:
<img srcset="{{ settings.logo | image_url: width: settings.logo_width }} {{ settings.logo_width }}w,{{ settings.logo | image_url: width: settings.mobile_logo_width }} {{ settings.mobile_logo_width }}w" sizes="(min-width: 750px) {{ settings.logo_width }}px,(max-width: 749px) {{ settings.mobile_logo_width }}px" src="{{ settings.logo | image_url: width: settings.logo_width }}" alt="{{ settings.logo.alt | default: shop.name | escape }}" height="{{ settings.logo_width | divided_by: settings.logo.aspect_ratio }}" width="{{ settings.logo_width }}" fetchpriority="high" >
Am I pointing this correctly? How this should work for other images on the page
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025