IMG

Description

Embeds an image or a video clip in the document.

Syntax

<IMG
ALIGN=ABSBOTTOM | ABSMIDDLE | BASELINE | BOTTOM | LEFT | MIDDLE | RIGHT | TEXTTOP | TOP
ALT=alternative text
BORDER=pixels
CLASS=Style Sheet class name
DATAFLD=colname
DATASRC=Data Source
DYNSRC=url
HEIGHT=n
HSPACE=n pixels
ID=value
ISMAP
LANG=language
LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT | VBS
LOOP=n
LOWsrc=url
NAME=name
SRC=url
STYLE=styling
TITLE=text content
USEMAP=url
VSPACE=n pixels
WIDTH=n
event = script
>

Parameter

Description

ALIGN

Specifies the alignment for the image. The possible values of this attribute are: left, right, top, texttop, middle, absmiddle, baseline, bottom, absbottom.

ALT

Optional text as an alternative to the graphic for rendering in non-graphical environments. Alternate text should be provided whenever the graphic is not rendered. Alternate text is mandatory for Level 0 documents.

BORDER

Specifies the thickness of a border to be drawn around the element.

CLASS

Class of the tag being defined. This is used to associate a subclassed style sheet with the tag.

DATAFLD

The column name from the data source object that supplies the bound data.

DATASRC

Indicates the ID of the data source object that supplies the data that is bound to this element.

DYNSRC

Specifies the address of a video clip or VRML world to be displayed in the window. Stands for Dynamic Source.

HEIGHT

Along with WIDTH, specifies the size at which the element is drawn. This attribute may be initially set in pixels or percentages.

HSPACE

Along with VSPACE, specifies horizonal margins for the element

ID

SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underscore character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.

ISMAP

Identifies the picture as a server-side image map. Image maps allow users to access other documents by clicking different areas in an image. Server-side image maps require a script or other service on the server to process click information. When the user clicks on the image, the server receives the coordinates of the user's click along with the URL of the map. Internet Explorer appends a "?" and a comma-separated pair of x-y coordinates to the HREF attribute in the A element. For further information regarding server-side maps and the content of the map file, check your HTTP server documentation.The ISMAP attribute identifies an image as an image map. Image maps are graphics in which certain regions are mapped to other documents. By clicking on different regions, different resources can be accessed from the same graphic.

LANG

Specifies which language to use in ISO standard language abbreviation form.

LANGUAGE

Specifies the language the current script is written in and invokes the proper scripting engine. The default value is JAVASCRIPT.
* JAVASCRIPT, JSCRIPT The script is written in JScript.
* VBS, VBSCRIPT The script is written in VBScript.

LOOP

Specifies how many times a sound or video will loop when activated. Also specifies how many times the marquee should loop.

LOWSRC

Specifies a lower resolution image to be displayed initially while the document is loading, which is later replaced by the higher quality version SRC.

NAME

Window or frame at which to target the contents. If no frame or window exists that matches the specified target, a new window is opened for the specified link. If no target is specified, the default is "_self" for a link within the same site or "_top" if the site is external. Special target values are:
_blank Specifies to load the link into a new unnamed window.
_parent Specifies to load the link into the immediate parent of the document the link is in.
_self Specifies to load the link into the same window the link was clicked in.
_top Specifies to load the link into the full body of the current window.

SRC

Specifies a URL for the associated file.

STYLE

Inline style sheet for the tag.

TITLE

The TITLE attribute is for advisory information (unless used with a mailto: attribute). The Title attribute should provide the title of the document whose address is given by the HREF attribute. The contents of the title attribute will be displayed in a tooltip during the mouse moves on the link. Internet Explorer 4.0 (and above) is the only browser to implement this.

USEMAP

Identifies the picture as a client-side image map and specifies a MAP to use for responding to the user's clicks. Use the MAP and AREA elements to create the client-side mapping information.

VSPACE

Along with HSPACE, specifies vertical margins for the element.

WIDTH

Along with HEIGHT, sets the initial size of the element. This attribute may be initially set in pixels or percentages.

event

Can be one or more of these events:
onabort ;
onafterupdate ;
onbeforeupdate ;
onblur ;
onclick ;
ondblclick ;
ondragstart ;
onerror ;
onfocus ;
onhelp ;
onkeydown ;
onkeypress ;
onkeyup ;
onload ;
onmousedown ;
onmousemove ;
onmouseout ;
onmouseover ;
onmouseup ;
onresize ;
onrowenter ;
onrowexit ;
onselectstart

Example

<img src="image/cp.gif" lowsrc="image/dian.gif"width="100" height="100" align="middle">

Related Topics

AREA, INPUT, MAP