I want to wrap a text within only two lines inside div of specific width. If text goes beyond the length of two lines then I want to show elipses. Is there a way to do that
See http://jsfiddle.net/SWcCt/.
Just set a line-height the half of height:
line-height
height
line-height:20px; height:40px;
Of course, in order to make text-overflow: ellipsis work you also need:
text-overflow: ellipsis
overflow:hidden; white-space: pre;