How to fold a paragraph and replace the rest of the content with ‘…’?

Well, I have content within a paragraph, maybe like this:

<div style="width:30px">

We all know that the content will be divided into many lines because of its parent’s width, but I just want to keep the top 2 lines, the rest is replaced with’…’. I am wondering how to accomplish it ?Tell me please.

Source: jquery

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.