Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

HTML img element

3 tags 1 category

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

You need at least two attributes for each <img> element. Most commonly, they are src and alt.

The src attribute holds the path to the image you want to embed. It is not mandatory if the srcset attribute is available. However, at least one of the src or srcset attributes must be provided. The alt attribute holds a textual replacement for the image, which is mandatory and incredibly useful for accessibility — screen readers read the attribute value 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 link rot.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…