What is the alt attribute in HTML?

The alt attribute is used for displaying a text in place of an image whenever the image cannot be loaded due to any technical issue.

<!DOCTYPE html>

<html>

  <body>

    <h2>HTML Alt Example</h2>

    <img src=”tulip.jpeg” alt=”Tulip Garden” />

  </body>

</html>


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *