Open In App
Related Articles

HTML | <img> alt Attribute

Improve Article
Improve
Save Article
Save
Like Article
Like

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>GeeksforGeeks</h1>
 
    <h2>HTML img alt Attribute</h2>
 
    <img src=
         alt="GeeksforGeeks 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
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 22 Jul, 2022
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials