HTML <img>
query_builder | Christopher PisaniThe HTML element <img> embeds an image into the document. No closing tag is required for this element.
<img
src="https://interactive-examples.mdn.mozilla.net/media/examples/grapefruit-slice-332-332.jpg"
alt="Grapefruit slice atop a pile of other slices">
Available Attributes
Attribute | Values | Functionality |
---|---|---|
alt | text | Places alternative text for the image |
crossorigin | anonymous use-credentials |
allow images from cross-origin website that are allowed |
height | numeric value | The height of the image |
width | numeric value | The width of the image |
ismap | Specifies an image as a server-side image-map | |
longdesc | URL | A link to a description for the image |
sizes | Specifies image sizes for different page layouts | |
src | URL | The source of the image |
srcset | URL | An alternative URL for the image |
usemap | #mapname | Specifies an image as a client-side image-map |