HTML img alt Attribute – GEMCODE

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

Reading Time: < 1 minute

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

Spread the Code

GEM

Author

You may also like...

Leave a Reply

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