HTML img alt Attribute – GEMCODE

Last updated on February 25th, 2022 at 01:32 pm

Definition and Usage

The required alt attribute specifies an alternate text for an image, if the image cannot be displayed.

 

The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

Example An image with an alternate text :

Syntax

<img alt=”text“>

Example:

<p><img src=”https://www.gemcode.in/wp-content/uploads/2020/04/android-chrome-512×512-1.png” alt=”Girl in a jacket” width=”500″ height=”600″ /></p>

Girl in a jacket

Share Post

2 thoughts on “HTML img alt Attribute – GEMCODE”

Leave a comment