The img tag has two attributes, namely alt and title. Many beginners are still confused about the correct use of these two attributes. Of course, part of the reason is also caused by the IE browser. In addition to improving the search ability of images, the correct use of these two attributes is also very helpful in user experience. Let’s talk about the concepts and correct use of alt and title.
alt
The essential function of this attribute is to replace the text when the image cannot be displayed correctly. However, it also plays the role of title (text prompt after the mouse is placed on it) under IE6. IE's implementation is actually wrong. If you want to display a prompt when the mouse rolls over, you should use the title attribute. Due to wrong guidance, many beginners only add the alt attribute to the img tag. So here’s another compliment for FF!
Title
The text prompts displayed when the mouse slipped over, the user experience is very important. Of course, it is not necessary to add this attribute to all img tags. For example, if the logo is more important or the image content that users will experience, it is recommended that this attribute be added.