The ALT text (also referred to as ALT tag or Alternate text) is the text that is included within the image tag in HTML. It is used to specify an alternative text description for the image, just in case, the image doesn’t load.
Have you noticed a text that appears when you hover over an image on a web page?
A typical syntax for an image tag in HTML is as follows,
<img src=’image-filename’ width=’X’ height =’Y’ alt=’ALT Text’>
As indicated in the above syntax, alt=’ALT Text’ is where you will include a relevant text description for the image.
The ALT text comes in handy when your image doesn’t load for some reason. It could be due to a broken link, a missing image, poor connectivity, and so on. It looks odd to see an empty white spot on your webpage. Doesn’t help with the user experience.
In such cases, our ALT text kicks in and displays the alternate text that we have specified.
Including an ALT text in your image tag is a good practice as far as search engines and accessibility is concerned.
While we are on this topic of good practices for search engines, it’s recommended that you include the keyword(s) you are targeting for the current page or use relevant images to describe the image.
That being said, don’t go overboard and stuff keywords into your ALT text.