HTML - Image Tag

Image tag is use to display jpeg, gif, bmp etc image display on browser using <IMG></IMG> tag.
 
Example:
 
<HTML>
 
<HEAD>
 
<TITLE>Placing Image on Web Page</TITLE>
 
</HEAD>
 
<BODY>
 
<IMG src=”E:\Neeta\Images\elephnt1.gif” height=200 width=200 hspace=15 vspace=15 border=3 alt=”Elephant”>
 
</BODY>
 
</HTML>
 
 
For placing any image on the web page use <IMG> tag. It is an empty tag. 
 
Various attributes are as follows:
 
src: It specifies the source of image. You can give .bmp, .gif or .jpg file.
 
height: It specifies the height of the picture. It is can be either in pixel (default), percentage or en.
 
width: It specifies the width of the picture. It is can be either in pixel (default), percentage or en.
 
border: This attribute specifies the border of the image. The value of the attribute is numeric value.
 
align: This attribute specifies the alignment of the picture. Possible values are left, right, middle, top, bottom.
 
hspace: This attribute specifies the horizontal space i.e. left and right side of the picture.
 
vspace: This attribute specifies the verticle space i.e. top and bottom of the picture.
 
alt: This attribute specifies the text when you mouse over any image i.e. a tool tip like text.Example: