css text displays ellipsis if it is too long, mouseover ellipsis displays the entire content

Sometimes we will find that when the mouse hovers over the text ellipses, the entire content will be displayed. The effect is as follows:
Insert image description here
First, if the text is too long, the ellipses will be displayed.

// width 设置一定的宽度
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

Then use the mouse to hover the label to display the characteristics of its title content, and add the title attribute to the label to achieve the effect we want.
Insert image description here
Introduction to the title attribute :

Insert image description here

Guess you like

Origin blog.csdn.net/xiaoxiannv666/article/details/129690363