Introduction of HTML Images
Images on webpage should be attractive and beautiful. You can add an image on the webpage using HTML. For this, you will have to use <img> tag. The <img> tag provides many attributes from which you can control the presentation of the image.
Syntax and Attribute of <img> tag
<img src=”url” alt=“text”><img>
<img> tag is an empty tag because it is without closing/end tag. It contains attributes only.
src:- src attribute specifies the URL (web address) and Path of the image.
alt:- alt attribute provides an alternate text instead of image, if the user unable to view image because of slow connection.
width:- With this attribute, you can set the width of the image.
height:- With this attribute you can set the height of the image.
style:- With this attribute you can apply CSS rules on the images.
Including images in web page
You can use <img> tag to include images in any webpage as mentioned above. The use of src attribute with <img> tag is necessary. All the attributes are optional. Example of this tag is below.
0 Comments:
Post a Comment
Thank you for reading this post. Please do not enter any spam link in the comment box.