Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Responsive images have landed

Responsive images have landed

An introduction to responsive images standards: , @srcset and @sizes.

Derek Johnson

October 09, 2014
Tweet

More Decks by Derek Johnson

Other Decks in Technology

Transcript

  1. • Resolution switching • Viewport based • Pixel density •

    Art direction • Design breakpoints • Media types • Relative units • Image formats • User control of source
  2. <picture> <source srcset="images/asio-otus-300.webp 300w, images/asio-otus-400.webp 400w, images/asio-otus-600.webp 600w, images/asio-otus-800.webp 800w"

    sizes="(min-width:78.947em) 18.75em, (min-width:74em) 23.75vw, (min-width:60em) 31.6666667vw, (min-width:38em) 47.5vw, 95vw" type="image/webp"> <source srcset="images/asio-otus-300.jpg 300w, images/asio-otus-400.jpg 400w, images/asio-otus-600.jpg 600w, images/asio-otus-800.jpg 800w" sizes="(min-width:78.947em) 18.75em, (min-width:74em) 23.75vw, (min-width:60em) 31.6666667vw, (min-width:38em) 47.5vw, 95vw" type="image/jpeg"> <img src="images/asio-otus-300.jpg" alt="Long eared owl"> </picture>