The Importance of alt Attribute
Alt is called an alternate text of an image if the image fails to load due to poor internet or incorrect path of an image. It is an HTML attribute of the image. It is very helpful for blind or screen readers they can easily understand what image is on the website after reading the alternate text of an image.
Alt attribute contains a short description of an image, what the image is?. Alt is also important for SEO because search engines don’t read media files so it is mandatory to use alt attributes in an image to make understand search engine crawler properly.
Why alt Attribute is important?
There are a few reasons why should we use alt attribute, which is the following:
1. Explain about image If fails to load
Alt attribute is an alternate text of an image, it contains a short description of an image. Sometimes image fails to load due to poor internet or incorrect path. So alt attribute helps us to get an idea of what image is missing.
2. Helpful for Blind/Screen readers
If we use the alt attribute, it is very helpful for screen readers or blind people that can’t see images. They read the alt attribute of an image to make them understand what the image is about.
3. Mandatory in SEO
Nowadays alt attribute is mandatory in SEO. Search Engines don’t read media files; they read text only so alt attribute is mandatory to use in an image to make search engines understand properly. Most SEO experts use keywords in image alt to target keywords, which you can also use but you should keep in mind you don’t do keyword stuffing, which means don’t use keywords unnecessarily.
How to write good alt text for an image?
To write good alt text for an image, there is simple logic, you write a relevant short description of an image don’t write too much, you have to write less than 125 characters. You have to write meaningful text for an image.
Examples of Best Alt text for an image?
Okay alt text: <img src="bag.png" alt="bag">
Better alt text: <img src="bag.png" alt="safari bag">
Best alt text: <img src="bag.png" alt="blue laptop bag of skybag company">
Okay alt text: <img src="bird.png" alt="car">
Better alt text: <img src="bird.png" alt="white car">
Best alt text: <img src="bird.png" alt="skoda rapid white color car">