Alt texts

Maybe you have seen that you should always include an alt text (or alternate text) on images. But why do you actually need it? And when should you not do it?

The main reason for using alt texts is to describe what's in an image for users who can not see it. They might be blind, but they could also have blurry vision or maybe the image just didn't load because of a temporarily bad internet connection.

Examples of images where an alt text is recommended:

When should you not use alternate texts?

Sometimes you should actually avoid alt texts. If the image does not contribute anything meaningful or is not related to the content at all, it will not add any value to describe it. In that case you should use an empty alt text alt="" to indicate that you intentionally leave it empty.

Some examples of images where you can use an empty alt text: