0

I have a situation where I need to wrap my text into 2 lines only. It should not be wrapped more than 2 lines.

Is there any css available for this?

If not can this be done using jQuery?

Sarvap Praharanayuthan
  • 4,212
  • 7
  • 47
  • 72
Gautam
  • 1,728
  • 8
  • 32
  • 67

2 Answers2

1

Have a look at the three dots jquery plugin once: http://tpgblog.com/threedots/

It restricts the text to display only in two lines and it overrides the remaining text and instead of that it would display ellipsis.

Similar to the : Wrap a text within only two lines inside div

Community
  • 1
  • 1
web2008
  • 914
  • 4
  • 11
0

Without seeing your code, it is little difficult to say for "wrap a text in 2 lines". Since it also depends upon the height and width of your element.

<div style="word-wrap: break-word; width: 200px; border: 1px solid #ccc;" >
  Wrap a text in 2 lines only using jQuery or CSS
</div>

JSFiddle

Praveen
  • 55,303
  • 33
  • 133
  • 164