How can we use an image tag in HTML5 to effectively scale images? When scaling images, images that are specified in the media request are displayed instead of images inside srcset, which are set together with the pixel ratio of the device.
This is one of the sites that I called: https://www.sitepoint.com/how-to-build-responsive-images-with-srcset/
Please find the code I used.
<picture> <source media="(min-width: 767px)" srcset="../images/kitten-large.png 1x, ../images/kitten-medium.png 2x, ../images/kitten-small.png 3x"> <source media="(min-width: 480px)" srcset="../images/gallery-img-3.jpg"> <img src="../images/kitten-large.png" > </picture>
source share