Understanding how "alt" attribute works

I have a small question on images. I noticed that the images in Discourse are without the alt attribute. For example:

<img alt="" width="50" height="50" src="/user_avatar/<domain>/user3242/50/36_2.png" class="avatar">

This image is the user’s avatar.
Is it possible to somehow add this attribute with some default title?

Are you talking about all images? all instances of avatars?

Avatars are tricky because ideally an alt tag would describe the content, and they all vary from user to user.

I think in cases where the user avatar is clicked to do something (usually show the usercard) the best practice would be to use the alt text to describe the action (e.g, “username’s user summary” or something)…


Hi Kris, thank you for the fast reply.
I was trying to use a SEO analysis website and it said that my webpage uses X images and all of them are without the “alt” attribute. As I understand, those attributes helping the searching engines. The question is, if it’s right and possible to add a title to those images.