Embedded content

The following elements are used to embed media or other objects into the document.

img

The img element is the image element:

<img alt crossorigin height ismap sizes src srcset width />

Attributes

The attributes that are used in the img element are as follows:

  • alt: This is the alternate text for the image. Use this to describe the image. This is used to enhance accessibility.
  • crossorigin: This lets the browser know whether this image should be fetched with a CORS request. If the image will be modified in a canvas element and not from the same domain name, then a CORS request must be used.
  • height: This is an attribute to set the height of the image.
  • ismap: This lets the browser know whether the image is used in a server-side map.
  • sizes: This ...

Get Web Developer's Reference Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.