What is the srcset attribute in an IMG tag and how to use it?
In short, Srcset is a new attribute which allows you to specify different kind of images for different screen-sizes/orientation/display-types. The usage is really simple, you just provide a lot of different images separating them with a comma like this: <img src=”https://stackoverflow.com/questions/19634463/image.jpg” alt=”image” srcset=”https://stackoverflow.com/<img> <descriptor>, https://stackoverflow.com/…, https://stackoverflow.com/<img_n> <descriptor_n>”>. Here is an example: srcset=”https://stackoverflow.com/image.jpg 160w, https://stackoverflow.com/image2.jpg 320w, … Read more