alt is the text that replaces the picture. When the picture cannot be displayed, alt will be displayed, and the title is the explanatory text when the mouse is pointing up.
If alt is an attribute of this picture, it is equivalent to Tell search engines what the image says. The search engine itself cannot recognize the content of the picture, so it is necessary to add the ALT attribute.
Therefore, the title of the picture can be absent, but if you are doing a website, you must have an ALT if you have a picture.
Alt is placed on the surface of img, title is placed on a, and the length of alt is limited to 100 characters, which is very helpful for SEO optimization
-
title: Very important, this is displayed on the title bar, which is the important keyword you want to set, generally set the precise point,
-
alt: Image attribute, it is best to name this the same as the most important keyword in the title, so that it will have a better effect on your optimization!
Recommended tutorial: “HTML Tutorial”
The above is the detailed content of the difference between the title and alt of the img tag. For more, please pay attention to other related articles on 1024programmer.com !