Collection of references for web development.

HTML img tag


The HTML <img> element is used for embedding images in a HTML document.


Attribute Value Description
alt string Alternative text string to display on browsers that do not display images. The alt is required if the href attribute is used.
crossorigin anonymous
Allow data from third-party websites that allow cross-origin access so you can reuse it.
decoding sync
Specifies the decoding hint that is sent to the browser.
height number Specifies the height of the element, default is measured in pixels.
ismap boolean Specifies whether the image is part of a map or not.
longdesc URL Specifies the URL to a detailed description of the image.
sizes list Specifies image sizes for different document sizes.
src URL The URL of the file to embed in the document.
srcset list Specifies a list of resources to be used for different conditions.
usemap #imagemapname Specifies the image map associated with the element.
width number Specifies the width of the element, default is measured in pixels.


<img src="" width="350" height="150" alt="Example Image 350x150">

More Examples