HTML image sizes and srcset attributes not working

Viewed 23

I have a Blade directive that generates an HTML <img> tag with srcset and sizes attributes. But only the 1280px option is used, regardless of the resolution (I do tests in Edge through the device emulation feature).

<img src="https://my.link/logos/casa-nova/logo.png" srcset="
      https://my.link/logos/casa-nova/logo414.png 414w,
      https://my.link/logos/casa-nova/logo768.png 768w,
      https://my.link/logos/casa-nova/logo1024.png 1024w,
      https://my.link/logos/casa-nova/logo1280.png 1280w,
      https://my.link/logos/casa-nova/logo.png" sizes="
      (max-width: 414px) 414px,
      (max-width: 768px) 768px,
      (max-width: 1024px) 1024px,
      (max-width: 1280px) 1280px,
      100vw" width="213" height="67" alt="alt">

0 Answers
Related