Home >Web Front-end >HTML Tutorial >What is the title function of img
The title function of img is to display a floating box with the text displayed when the mouse stays on the image. The title is a global attribute that provides additional prompt information. When the mouse slides to the element, the definition is displayed. tips.
title is a global attribute that provides additional prompt information. When the mouse slides over the element, the defined prompt is displayed. The title in the Link and style elements is special and represents the name of the style sheet; alt is a local attribute and can be used in elements such as img and input to provide alternative text when the image is loading or fails to load. Note that the alt attribute can only be used when the type attribute of the input element is image.
1. The title attribute is the content displayed when the mouse is moved up. The code is as follows:
<img src="eg_tulip.jpg" title="上海鲜花港 - 郁金香" / alt="What is the title function of img" >
2. The running effect is as follows:
Recommended Tutorial: "HTMLTutorial"
The above is the detailed content of What is the title function of img. For more information, please follow other related articles on the PHP Chinese website!