I am facing an issue with the following code snippet:
<img
src="/img/footer/logo_white.png?v=2.0"
srcset="/img/footer/logo_white.png?v=2.0 1x,
/img/footer/logo_white2x.png?v=2.0 2x"
>
This code works perfectly on regular and high DPI screens.
However, when the viewport's width is very small (below 400px), the logo appears distorted. To address this, I created a smaller version of the image based on the actual dimensions. I then attempted the following approach:
<img
class="biw-logo"
sizes="(max-width: 390px) 110px, 175px"
src="/img/footer/biw_logo.png?v=2.0"
srcset="/img/footer/biw_logo_small.png?v=2.0 110w,
/img/footer/biw_logo.png?v=2.0 175w,
/img/footer/biw_logo2x.png?v=2.0 350w"
>
This solution displays the _small image for viewports narrower than 390 pixels, but it sacrifices the "high resolution" aspect. With this code, I am unable to force the iOS browser on iPhone 5s to display a 220px long image at 110px length using the provided syntax.
Could you please assist me in correcting my syntax?
<img class="biw-logo" sizes="(max-width: 390px) 110px, 175px" src="http://placehold.it/175x75" srcset="http://placehold.it/110x50 110w,
http://placehold.it/175x75 175w, http://placehold.it/350x150 350w">