Responsive Images (Using Srcset & Sizes)

by Konstantin Rouda

HTML

<img sizes="(min-width: 700px) 80vw, 100vw" srcset="https://c1.staticflickr.com/5/4268/34511298993_d23b829aa3_z.jpg, https://c1.staticflickr.com/5/4198/34933905400_d2af450869_o.jpg 1920w" src="https://c1.staticflickr.com/5/4198/34933905400_d2af450869_o.jpg" />

CSS

/*
No need for css
*/

JavaScript

/*
In order to see an effect, please change view to Full Page view and reload page (it is better to reload page and clear cache)
*/