<img/> Tag Attributes

Attributes of the <img/> tag
global attributes In addition to the local attributes of the <img/> tag below, any of the common HTML attributes can also be coded.
width,
height
src

a URI reference that resolves to the URL of a two-dimensional image resource

Use percent escape codes as explained in the URL-encoding tutorial for any special characters in the URI reference.

If the value of the src attribute resolves to an HTTP URL, it may contain any of the following components:

  1. protocol scheme, typically http: or else https:
  2. username, followed by an "@"
  3. host name or IP address
  4. port number, which defaults to 80 for the http scheme and 443 for the https scheme
  5. absolute or relative path
  6. search query, indicated by "?"

If the protocol scheme, username, host name/IP address and port number are omitted the default is the current host - the same server as the base of the current document. If the path starts with a slash /..., it is an absolute path from the document root directory (AKA "web root") on the server. A relative path will be resolved relative to the base of the current document.

alt Provides alternative content when images are blocked or disabled or for users who are unable to view the image. See Difference between image alt text and image title below.
ismap="ismap" Sets the value of the <img ismap> boolean attribute to true. Omitting it sets to false.
usemap

a URI reference that resolves to the URL of an image map

Use percent escape codes as explained in the URL-encoding tutorial for any special characters in the URI reference.

Difference between image alt text and image title

The image alt text in the <img alt> attribute provides alternative content when images are blocked or disabled or for users who are unable to view the image.

The image title in the global title attribute provides a description of the image and may be displayed in a pop-up tool tip when the mouse is held over the image.