October 2017
Intermediate to advanced
370 pages
8h 57m
English
With srcset, we can specify different images to use at different viewport widths. The browser will then choose the most appropriate image for the user's device by picking the smallest image that is as large as, or larger than, the viewport width.
Building on our news article example from the last chapter, let's replace the amp-img feature image with the following (full code at /ch3/feature.html):
<amp-img ...
Read now
Unlock full access