HTML img tag is used to show image on the web page. We can insert image by using HTML img tag, closing tags are not used in HTML image element.
Below is the example of HTML image.
<h2>HTML Image Example</h2> <img src="india_gate.jpg" alt="India Gate" />
It is a important attribute that represent the source of the image. It tells the browser where is the image on the server. We can use image source from same directory or can use external source through image link.
The alt attribute defines an alternate text for the image, It is very important for SEO prospective because google can not read image, so alt tells google what kind of image it is. In other way alt attribute describe the image in words.
It is an optional attribute which is used to specify the width to display the image. It is not recommended now. You should apply CSS in place of width attribute.
We can define height of the image. The HTML height attribute also supports iframe, image and object elements. It is not recommended now. We can apply CSS in place of height attribute.