Which attribute is used to specify an alternate text for an image, if the image is not loaded properly in HTML ? Last Updated : 30 Jan, 2022 Comments Improve Suggest changes Like Article Like Report In this article, we will discuss the attribute that is used to specify an alternate text for an image, if an image is not loaded properly in HTML. The <img> alt attribute is used to specify the alternate text for an image. It is useful when the image is 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: The following example demonstrates the <img> alt attribute. HTML <!DOCTYPE html> <html> <head> <title> HTML img alt Attribute </title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML img alt Attribute</h2> <img src= "https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo.png" alt="GeeksforGeeks logo"> </body> </html> Output: When the image source is available:When the image source is not available: Comment More infoAdvertise with us Next Article Which attribute is used to specify an alternate text for an image, if the image is not loaded properly in HTML ? S sravankumar_171fa07058 Follow Improve Article Tags : HTML HTML-Attributes HTML-Questions Similar Reads Which property is used to control the scrolling of an image in the background ? In this article, we will discuss the property that is used to control the scrolling of an image in the background. The background-attachment property in CSS is used to specify the kind of attachment of the background image with respect to its container. It can be set to scroll or make it remain fixe 4 min read How to specify an alternate text for an image in HTML ? The alternative text for an image is useful when the image not displayed/loaded. If the image is not loaded the its alternative text is displayed on the web page. Alternative text is the alternative information for an image. Example 1: In this example, the image path contains the image so it will di 1 min read What is the use of alternative text in image mapping in HTML ? In this article, we will see how alternative text can be useful to provide metadata related to the images in the case when the image can't load properly. The reason for being not loading properly may arise due to slow internet connectivity, images get removed from the web page, the absolute path for 3 min read Which property is used to set the background image of an element using CSS ? In this article, we will see the property used for setting the background image of an element in CSS. The background image can be set using the background-image property that is used to set one or more background images for an element. By default, it places the image in the top left corner. To speci 1 min read Describe the purpose of using alt attribute in <img> tag in HTML The <img> alt attribute is used to specify the alternate text for an image. It is useful when the image is not displayed. It is used to give alternative information for an image. It is also very much helpful in the Google ranking of your page. In this article, we will discuss the alt attribute 1 min read Like