Inspired by this post where someone would
want to have an active title property for only those list items that trigger the text-overflow rule on the list. So you can hover the mouse over any text that is truncated and see a tooltip of its full text
Here is my approach.
<div> <span><span>Some longer text visible on hover</span></span> <span><span>Another longer text visible on hover</span></span> <span><span>Short text</span></span> </div>
div { display: grid; grid-template-columns: 100px 100px 100px; } div>span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } span>span:hover { position: absolute; background-color: rgba(5, 255, 255, 1); }
The above is the detailed content of Show full text on hover with text-overflow: ellipsis. For more information, please follow other related articles on the PHP Chinese website!