HTML | <img> alt Attribute

The <img> alt attribute is used to specify the alternate text for an image. It is useful when the image not displayed. It is used to give alternative information for an image. 

Syntax:

<img alt="text">

Attribute Values: It contains single value text which specifies the alternative text for an image. 

Example: 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML img alt Attribute
    </title>
</head>
 
<body>
    <h1>w3wiki</h1>
 
    <h2>HTML img alt Attribute</h2>
 
    <img src=
"https://media.w3wiki.net/wp-content/uploads/20190506164011/logo3.png"
         alt="w3wiki logo">
 
</body>
 
</html>


Output:

  

Supported Browsers: The browser supported by HTML <img> alt Attribute are listed below:

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

Contact Us