October 2017
Intermediate to advanced
370 pages
8h 57m
English
Responsive design is built directly into AMP, and is one of the most useful layouts offered by the layout attribute. We saw how to use amp-img with the responsive layout in our news article example from the last chapter:
<amp-img src="img/feature.jpg" width="768" height="305" layout="responsive" ></amp-img>
Note that even though we are using the responsive layout, we still need to specify the width and height attributes. Shouldn't it just grow and shrink to fit the viewport? There are two reasons why the width and height attributes are needed:
Read now
Unlock full access