How to truncate the long text using css?

Priya
Priya
1194 Points
33 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: 9791
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
2890 Points
78 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
118 Points
3 Posts
         
.truncate {
  width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
Posted On: 08-May-2018 20:15
 Log In to Chat