<img>

The image element embeds a raster or vector image into the document.

Since HTML 2.0 Spec ↗

Syntax

<img src="url" alt="description">

Examples

<img src="/photo.jpg" alt="A cat sleeping on a keyboard"
     width="640" height="480" loading="lazy">
Output
Renders the image at its intrinsic 640x480 box; if it fails to load, the alt text is shown instead.

Notes

The alt attribute is required for accessibility; use alt="" for purely decorative images. Always set width and height (or aspect-ratio) to reserve layout space and prevent CLS. Use loading="lazy" for offscreen images and srcset/sizes for responsive images.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also