Search code snippets, questions, articles...

Add an image on Webpage AMP

If you want to add an image on your AMP webpage HTML you can use HTML element to add that.
<amp-img src="" alt="Image description here" width="640" height="480"></amp-img>

If you are creating your webpage using AMP then you can not add an image using the <img> tag. This will not validate the AMP page and if you are using <img> HTML element to render an image on the webpage.

To render an image on the AMP webpage you can use the <amp-img> tag and provide the URL of the image in the src property. The AMP will take care of lazy loading and fast rendering of the image on the webpage.

Search Index Data (The code snippet can also be found with below search text)

Include image AMP
Was this helpful?
Programming Feeds
Learn something new everyday on Devsheet