Macro laby::img

source ·
img!() { /* proc-macro */ }
Expand description

<img> element.

The <img> HTML element embeds an image into the document.

The above example shows usage of the <img> element:

  • The src attribute is required, and contains the path to the image you want to embed.
  • The alt attribute holds a text description of the image, which isn’t mandatory but is incredibly useful for accessibility — screen readers read this description out to their users so they know what the image means. Alt text is also displayed on the page if the image can’t be loaded for some reason: for example, network errors, content blocking, or linkrot.

There are many other attributes to achieve various purposes: