Correct use of alt and title attributes in img tag_Experience exchange

WBOY
Release: 2016-05-16 12:06:23
Original
1928 people have browsed it

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.

Correct use of alt and title attributes in img tag_Experience exchange

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!