What HTML element is used to insert an image?

The story behind the answer

What HTML element is used to insert an image? The answer is img. The HTML `img` element embeds an image resource in a document, usually with a `src` attribute identifying the file: `<img src="photo.jpg" alt="A mountain lake">`. The element itself tells the browser that an image belongs there; the attribute supplies important details about which image to fetch.

`img` is a void element, meaning it cannot contain child content and does not have a normal closing tag. In HTML, `<img>` is sufficient, although XHTML’s XML syntax traditionally wrote it as `<img />`. The `alt` attribute provides replacement text for screen readers and appears when the image cannot be displayed.

The most frequent confusion is treating `src` as the element. `src` is an attribute, not a tag. The `picture` element is different: it provides responsive image choices, often containing one or more `source` elements and an `img` fallback. For decorative images, authors can use an empty `alt` value; meaningful images should receive concise alternative text.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: