How to truncate the long text using css?

Priya
Priya
Member
62 Points
26 Posts

Hi ,

I have a div with some text. I want the text not exceed the new line.  I want to do this using css.

Is there any way to do so through css?

Views: 8208
Total Answered: 2
Total Marked As Answer: 1
Posted On: 05-May-2018 02:13

Share:   fb twitter linkedin
Use Ellipsis in the text-orverflow=> text-overflow: ellipsis
 - Brian  05-May-2018 02:18
Answers
Smith
Smith
Participant
374 Points
112 Posts
         

Use following css class

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

As

<div class="truncate"> Some long text. Some long text. Some long text. Some long text </div>
Posted On: 05-May-2018 02:21
andro
andro
16 Points
8 Posts
         
.truncate {
  width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
Posted On: 08-May-2018 20:15
 Log In to Chat