design tip

Truncate the string

I hate when my text doesn’t suit inside the div, and it goes out anesthetically. In Javascript, there are a few ways how we can manage it but, did you know that it’s possible to cut the text in CSS as well? Let’s check it out: Above, you can see how CSS can cut the text and finish it with …. I used overflow: hidden, white-space: nowrap, and finally to got three dots, I used text-overflow: ellipsis.