So I am trying to combine word-break with text-overflow which does work at some point but not how it should be.
For example, I have set up this Fiddle
CSS:
width: 200px;
padding: 8px;
border:1px solid blue;
word-break: break-word;
height: 100px;
overflow: hidden;
text-overflow:ellipsis;
white-space:nowrap;
For clarification, once text is broken in to parts it should fill box and at the end of the text there should be 3 dots.
Currently there is just a single line where it works.
As far as I know, this is not possible using CSS.
The only thing you could do is specify the
height, andoverflow:hidden. (No ellipsis in the end.)This is stated in the W3 spec for text-overflow.
You will need to use JavaScript for achieving this.
Here is an example of a jQuery plugin : http://pvdspek.github.com/jquery.autoellipsis/