IMAGE TAG 

The <img>  tag  is a empty tag .This tag  is used to set an image into  your html  page.There are many attribute that we can use with  <img> tag  like SRC,ALIGN ,WIDTH,HEIGHT ,VSPACE,HSPACE,BORDER AND BORDERCOLOR ,ALT etc. 

1.SRC Image Attribute.


The most important attribute which is required is SRC .Src stands for source of an image.
Syntax :

        <img src=”image name.extension or Format
        <img src=”life.jpg”>
Note-file must be in same directory. Suppose you have saved your HTML file(ABC.html) in folder  AKASH . Your image file life.jpg should be in the AKASH folder.

Here life is a file name and jpg is format of the file. There are many different format you can use like .bmp , .jpg , .gif  etc.
Or
<img src=”Write Complete source path”>
Ex.
<img src=”d:\images\lifeskill.jpg”>
Means we want to show an image lifeskill.jpg  that image must be in the folder images which is in Directory "d:”. 

2.Height  & width
Both the tags are used to set the height and width of the image in pixel like height=500 width=600.



SAVE THIS IMAGE

Example
1.
<html>
<head>
<title>image</title>
</head>
<body>
<font color="red" size="+5" >
<p align="justify">When you put faith ,hope and love together you can raise positive kids in negative world.
</p></font>
<center>
<img src="2.jpg" Align=center   height=500 width=700 />
<center>
</body>
</html>

No comments:

Post a Comment

  HTML IBM introduced GML (general mark-up language) 1980's . it was a language that aimed to create web page by using headings ,text ...