The void HTML <img /> element represents an image to be retrieved from a server separate from the containing page. The image and page are typically stored on the same server, but otherwise this is known as hotlinking and considered very impolite without permission, as the other server must expend resources without benefiting from traffic to pages. Those resources often cost the server administrator and/or the image's owner, and traffic is commonly used to generate income which offsets this cost and possibly provides a living. If you have rights to display such an image, you may save it to your computer and upload it to your own server where it will not consume the other server's resources if linked to locally.


Optional attributes

Attribute Value Description
src URL The location of an image file.
alt text A short description of the image specified as the src, fit for replacing the image if necessary (especially in browsers which cannot render images, such as screen-readers). Some browsers use this as the default for the title, and/or vice versa.
height pixels The height of the image, measured in CSS pixels.
width pixels The width of the image, measured in CSS pixels.
usemap hash-name The hash-name of a map which defines clickable portions of the image.
ismap Boolean Informs the browser that a map of the image's clickable regions is available at the URL specified in the containing anchor's href attribute. This attribute is inaccessible, and usemap is recommended instead.[1]

Global attributes

See Global HTML Attributes.



External links