In this tutorial, we are going to learn to add images to an HTML page using the <img> tag.
We can use the <img> tag to add an image to the page. Since the <img> tag is an empty element, it requires no closing tag. The following attributes can be used with the <img> tag.
| Attribute | Description |
|---|---|
| src | Specifies the location of the image file. |
| alt | Provides text description of the image. Browsers displays this text when you cannot see the image. |
| title | Provides additional information about the image. |
The height and width of images can be specified by the attributes height and width respectively.
For example,
<img src="https://teachics.org/wp-content/uploads/2021/12/cat-2.jpg" alt="Cat" title="The cat is a domestic species of small carnivorous mammal." width="640" height="425">
Output
