0

i have tried giving css(ellipsis) property. but it is trimming the first line itself.i need to show two lines (if i can set up max length character also is fine). I have gone through the 'limit' property in angular to trim text but it is not happening inside this InnerHTML content. please see my HTML:

<div>
  <p class='ellipsis' [innerHTML]="news.newsText"></p>
  <a href="javascript: void(0)" (click)="readmoreFunc(news)">Read more</a>
</div>

This is the result in UI by now. This is the result in UI by now...

1 Answers1

0
.ellipsis {
   overflow: hidden;
   text-overflow: ellipsis;
   display: -webkit-box;
   -webkit-line-clamp: 2; /* number of lines to show */
   -webkit-box-orient: vertical;
}

I think this will work.

JithinAji
  • 402
  • 5
  • 16