Home > Article > Web Front-end > What is the difference between title and alt of img tag?
alt is the text that replaces the picture. When the picture cannot be displayed, alt will be displayed. title is the explanation text when the mouse points up.
If alt is an attribute of this picture , which is equivalent to telling the search engine what this picture is about. The search engine itself cannot identify the content of the image, so you need to add the ALT attribute.
Therefore, the title of the picture does not need to be included, but if you are building a website, if you have pictures, you must have ALT.
Alt is placed on img. Title is placed on a. The length of alt is limited to 100 characters, which is very helpful for SEO optimization.
title: Very important. This is what is displayed on the title bar, which is the important keyword you want to set. Generally, set it more accurately.
alt: Image attribute. It is best to name this with title. The most important keyword settings are the same, which will have better results for your optimization!
Recommended tutorial: "HTML Tutorial"
The above is the detailed content of What is the difference between title and alt of img tag?. For more information, please follow other related articles on the PHP Chinese website!