Image Tag in HTML
Image tags in HTML:
Images are binary formatted files with extensions like .jpg, .jpag, .png, .gif, .bnp.
Image tag (<img>) : Image tag will get the image into web page.
Elements of image tag :
Id – id of the image
Name – name of the image
Src – It finds the location of the image, It can get the image in 2types.
- Absolute images
- Relative Images
Example of image tag :
<img src=”blue hills.jpg width=”300px” height=”500px”/>
Absolute images : It specify the full location of the image with protocol also.
Relative images : Relative path can get the image in 3 types
- Getting the image in current working directory.
- Getting the image in sub directory of current working directory.
- Getting the image from previous working directory.
Attributes of image tag :
1) Width : width of the image.
2) Height : height of the image.
3) Border border of the image.
4) Align : change the alignment of the image (align=”left”/”right”)
5) Title : display the content when placing the cursor on the image.
6) Alt : alternative information about the image, when image not found.
Example :
No comments:
Post a Comment