Inserting Image Files in HTML Languauge

Inserting Image Files

you can include images in your HTML document, which will be displayed in the web page created by that document. Browsers can display images stored in proper format in files with .JPG(Joint Photographic Group), .JPEG(Joint Photographic Experts Group), .GIF(Graphics Interchange Format),
.BMP(Bitmap) or .XBM(X Bitmap) extention.

An image is placed in the HTML document by <IMG> tag.Name of the image file with path (if required) is specified in this tag as the value of its attribute SRC.If the file named in the picture is available in the spcified place, then it is displayed at the place, otherwise a small place holder is displayed at the place of the picture.

We have placed an image in our HTML document.

 <title> Inserting Image </title>
 <h3>Show Image</h3>
 <img src="foldername/mypic.jpg">
 <p>This is image</p>


The <img> tag has many attributes. These are described below:

SRC Attribute
This attribute specifies the name and location of the source file, where image is stored. This is an essential attribute of <img> tag.

<img src="mypic.jpg">

Alt Attribute

This attribute is used to specify the alternate text for the image.

<img src="mypic.jpg" alt="This is my picture">