Truncate String using CSS (ellipsis)

We can limit a text length using css properties. All the following css properties are required, so the text must be in a single straight line that overflows a box where that overflow is hidden.

.div-truncate {
width: 250px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkedin
Share On Pinterest

Be the first to comment

Leave a Reply

Your email address will not be published.

*


*