|
|
|
HTML Image display |
HTML provides <img> tag to place image in a web page. img stands for image. This tag does not have any closing tag.
Attributes of <img> tag are :
Src: Src stands for Source. Specifies the name of the image file to be used.
Height: Used to specify the height of the image.
Width: Used to specify the width of the image.
alt: This is used to display some text when the visitors mouse over the image. i.e., it acts as a tool tip for the image. Alt tags are important for search engines as robots can't read images, to tell about the image we can add alt tag or alternate text to tell about the image. This also helps in accessibility issues of the website
HSpace: Used to specify the amount of space to the left and right of the image.
VSpace: Used to specify the amount of space to the top and bottom of the image.
Border: We can specify the border around the image. Border = 2 will add two pixcel border to the image.
Example Code:
<img width=400 height=50 border=0 hspace=0 src="image.gif">
Note: If the path of the image file is not mentioned it will search for the image in the current directory.
| |
|
|
|