0 points

How to "truncate" long strings with an ellipsis (...) for text that overflows its container


dashboard

Sun Jan 05 2020 18:59:56 GMT+0000 (UTC)

Posted by @billion_bill #css #webdev #text

.truncate {
  width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
content_copy

Just add the truncate class to the text element.

https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/

>> Browse more code snippets

more_vert