HTML4 HTML5
Embeds images in an HTML document. Void (self-closing) element that contains no closing tag or inner content.
Closing tag is disallowed.
Attributes:
src – (Required) Path or URL to the image file.alt – (Required for accessibility) Alternative text displayed if the image fails to load or for screen readers.width – Image width in pixels.height – Image height in pixels.loading – Lazy or eager loading behavior (lazy or eager).Code:
The browser will interpret this code as follows: