IMG (Image) TAG and ATTRIBUTES

<IMG></IMG>

This element indicates a media object to include in an HTML document. Usually, the object is a graphic image, but some implementations support movies and animations.


ATTRIBUTES

ALIGN = "BOTTOM | LEFT | MIDDLE | RIGHT | TOP"
     "ABSBOTTOM | ABSMIDDLE | BASELINE | TEXTTOP"
ALT = "alternative text"
BORDER = "pixels"
CLASS = "class name(s)"
HEIGHT = "pixels"
HSPACE = "pixels"
ISMAP
LOWSRC = "URL of low-resolution image"
NAME = "unique alphanumeric identifier"
SRC = "URL of image"
STYLE = "style information"
USEMAP = "URL of map file"
VSPACE = "pixels"
WIDTH = "pixels"

EVENTS

onclick
ondblclick
onkeydown
onkeypress
onkeyup
onmousedown
onmousemove
onmouseout
onmouseover
onmouseup


ALIGN  This attribute controls the horizontal alignment of the image with respect tot he page. The default value is LEFT.

ALT  This attribute contains a string to display instead of the image for browsers that cannot display images.

BORDER  This attribute indicates the width in pixels of the border surrounding the image.

CLASS  See Cascading Style Sheets (CSS) Information.

HEIGHT  This attribute indicates the height in pixels of the image.

HSPACE  This attribute indicates the horizontal space in pixels between the image and surrounding text.

ISMAP  This attribute indicates that the image is a server-side image map. User mouse actions over the image are sent to the server for processing.

LOWSRC  This attribute contains the URL of an image to be initially loaded. Typically, the LOWSRC image is a low-resolution or black-and-white image that provides a quick preview of the image to follow. Once the primary image is loaded, it replaces the LOWSRC image.

NAME  This common attribute is used to bind a name to the image. In conjunction with scripting languages it is possible to manipulate images by their defined names to create effects such as "rollover" buttons.

SRC  This attribute indicates the URL of an image file to be displayed.

STYLE  See Cascading Style Sheets (CSS) information.

USEMAP  This attribute makes the image support client-side image mapping. Its argument is a URL specifying the map file, which associates image regions with hyperlinks. Typically, when you use the USEMAP attribute, the URL is a fragment, such as #map1, rather than a full URL.

VSPACE  This attribute indicates the vertical space in pixels between the image and surrounding text.

WIDTH  This attribute indicates the width in pixels of the image.
Back to Top