Include an image

Most HTML tags can be used directly in AMP HTML, but certain tags, such as the <img> tag, are replaced with equivalent or slightly enhanced custom AMP HTML tags (and a few problematic tags are outright banned, see HTML Tags in the specification).

To demonstrate what additional markup could look like, here’s the code required to embed an image into the page:

<amp-img src="welcome.jpg" alt="Welcome" height="400" width="800"></amp-img>

READ ON – To learn why we’re replacing tags like <img> with <amp-img>, and how many are available, visit Include Images & Video.