/ Published in: CSS

The CSS text overflow ellipsis solution is perfect for single line truncations. I use this constantly when building mobile or responsive applications.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
span { display:block; /* because we're using a span class */ white-space: nowrap; /* This prevents the content from breaking onto another line */ width: 100%; /* this should be the width of your content */ overflow: hidden; /* hides the text that is outside of your width */ text-overflow: ellipsis; /* creates our ellipsis! */ }
URL: http://docs.tinyfactory.co/css/2012/08/11/text-overflow-ellipsis-using-CSS.html
Comments
