HTML - <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.



ALT="alternative text"
CLASS="class name"
ID="unique alphanumeric identifier"
LONGDESC="url of description file"
SRC="url of image"
STYLE="style information"
TITLE="advisory text"
USEMAP="url of map file"


ALIGN This attribute controls the horizontal alignment of the image with respect to the page. The default value is LEFT. The others value are ABSBOTTOM , ABSMIDDLE, BASELINE, and TEXTTOP.
ALT This attribute contains a string to display instead of the image for browser that cannot display images.
BORDER This attribute indicates the width in pixels of the border surrounding the image.
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.
LONGDESC This attribute soecifies a URL of a document that contains a long description of the image. This attribute is used as a complement to the ALT attribute.
SRC This attribute indicates the URL of an image file to be displayed.
USEMAP This attribute makes the image support client-side image mapping. Its argument is a URL spcifying the map file, which associates image regions with hyperlinks.
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.

Event Handlers

onclick Indicates that the element has been clicked.
ondblclick Indicates that the element has been double-clicked.
onmousemove Indicates that the mouse has moved while over the element.
onmouseout Indicates that the mouse has moved away from an element.
onmouseover Indicates that the mouse has moved over an element.


<IMG SRC="image1.jpg" ALT="image description" HEIGHT="100" WIDTH="100">
<IMG SRC="image2.jpg" USEMAP="map name" BORDER="0" HEIGHT="100" 
           WIDTH="100" ALT="image description">
<A HREF="otherpage.htm"><IMG SRC="image3.gif" WIDTH="100" HEIGHT="100" 
           ALT="Link to another page"></A>
Write a review