Asked by Harpreet · · 1 answer

The HTML <img> tag is used to embed an image in a web page. The <img> tag is empty, it contains attributes only, and does not have a closing tag. Example

<!DOCTYPE html>
<html>
   <head>
      <title>HTML img Tag</title>
   </head>

   <body>
      <img src="/html/images/test.png" alt="Simply Easy Learning" width="200" 
      height="80">
   </body>
</html>

<img src="https://qirolab.com/tags/html/HKAoY6tVJqcQowH7gPNjRSVPwYVKaKGuQ4xuzKaH.jpeg" alt="HTML" width="200" height="80">

The src attribute is used to add the image source i.e. URL of the image. The alt attribute is for adding alternate text, width for adding width, and height for adding the height of the image.

0