In this section, we will learn what alt attribute is and how to use it.
What is alt Attribute in HTML <img> Tag?
The alt attribute stands for alternative and in HTML <img> element is used to describe the target image. This description will appear in the document if, for whatever reason, the image didn’t load.
Also, search engines use the value of this attribute to learn about the target picture.
HTML alt Attribute in <img> Tag Syntax:
<img src = “description about the image”>
<img> Tag alt Attribute Values
The value of the alt attribute is a text description about the target image.
Example: using alt attribute in HTML <img> tag
See the Pen using alt attribute in HTML <img> tag by Omid Dehghan (@odehghan) on CodePen.