I have a list which have dynamic lengths on each list item. The maximum lines of the list would be 2. For those texts which overflow the 2 lines should be ended with dots. can user "white-space: nowrap;". but how can i specify the 2 lines. Any suggestions are highly appreaciated.example
li { line-height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100px; border: 2px solid #ff0000; } <ul> <li>long long name</li> <li>long long name long long name</li> <li>long long name long long name long long name</li> </ul>