What is the difference between title and alt of img tag?

hzc
Release: 2020-06-24 14:53:55
Original
6355 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!