1

I have a div like this -:

<div id="prep">Hey jony whats up. The new solar radars are of great use and may evern put some of the wacky scientist to brain strom. Crazy!</div>.

This is the associated css -:

#prep {
    height:32px;
    font-weight:bold;
    overflow:hidden;
    text-overflow:ellipsis;
    font-family: Arial, Helvetica, sans-serif;
    font-size:13px;
    line-height:16px;
    display:block;
}

Clearly only 2 lines of text would be visible. But since all the text would not fit in the the div, i want to show ellipses at the end of last visible line of text.

Antony
  • 14,900
  • 10
  • 46
  • 74
sanchitkhanna26
  • 2,143
  • 8
  • 28
  • 42

1 Answers1

0
You need to add a width, and white space.

    width: 56px;
    white-space: nowrap;
Abu
  • 124
  • 1
  • 1
  • 7