How do I only display part of a string using css

前端 未结 7 1915
梦谈多话
梦谈多话 2021-02-05 19:01

I want to be able to display a string of characters up to 10 characters. If the string goes over 10 characters, I\'d like to append \'...\' to the end.

For example, if

相关标签:
7条回答
  • 2021-02-05 20:08

    The ellipses is a css3 function and when testing in different browsers it has issues. A quick get around would be to define a specific with to the div or span with overflow hidden and then add a background images which says "..."

    0 讨论(0)
提交回复
热议问题