Automatic Retina images for web sites

There is a new attribute for the img tag that allows you to add a retina src attribute, namely srcset. No javascript or CSS needed, no double loading of images.

<img src="https://stackoverflow.com/questions/13744542/low-res.jpg" srcset="https://stackoverflow.com/high-res.jpg 2x">

Browser Support: http://caniuse.com/#search=srcset

Other Resources:

  • WebKit release post
  • W3C documentation for srcset
  • good explanation about why and how to use srcset
  • Chris Coyer’s post for more good info

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)