Currently there is no cross-browser CSS-only way to achieve such behavior.
You can do this now only in webkit-based browsers by using the -webkit-box
and -webkit-line-clamp
, see http://jsfiddle.net/ArKeu/7/
The css rule boils down to:
your-css-selector {
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 7;
-webkit-box-orient: vertical;
}
Where the number value for -webkit-line-clamp
is the maximal number of lines you want to be displayed.