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.
Exercise:-
We have placed an image in our HTML document.
<html>
<head>
<title> Inserting Image </title>
</head>
<body>
<h3>Show Image</h3>
<img src="foldername/mypic.jpg">
<p>This is image</p>
</body>
</html>
Attributes:-
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">