Browser loads images from srcset and original image

For example, I have img

:

<img src="images/image-520.jpg"
     alt="some image"
     srcset="images/image-1040.jpg 2x"
>

      

In normal mode, not in mesh displays, the browser only loads image-520.jpg

, but on retina displays, both chrome desktop and safari for iOS on first load and render image-1040.jpg

and after the event DOMContentLoaded

, they load the original image image-520.jpg

, Can anyone explain why is this happening and how can I avoid it?

+3
html html5 image responsive-design retina


source to share


No one has answered this question yet

Check out similar questions:

2639
How can I disable browser autocomplete on a web form field / input tag?
2190
How to render text or image with transparent background using CSS?
1929
How to make div 100% of browser window height
1832
Lazy loading images in ListView
1653
How to align checkboxes and their labels, consistently cross-browsers
1338
How to vertically align an image inside a div
1264
How can I automatically resize the image to fit the container div?
nine
Is there something wrong with my srcset definition, or is current browser support just weak?
0
srcset and sizes don't work in safari?
0
Responsive images using img srcset



All Articles
Loading...
X
Show
Funny
Dev
Pics