Skip to content

Instantly share code, notes, and snippets.

@codfish
Created October 24, 2013 01:21
Embed
What would you like to do?
"-webkit-line-clamp is an unsupported WebKit property that limits the number of lines of text displayed in a block element. In order to achieve the effect, it needs to be combo-ed with a couple of other exotic WebKit properties."
/**
* Truncate paragraph with an ellipsis, while specifying exactly how many lines you want
* source: http://dropshado.ws/post/1015351370/webkit-line-clamp
*/
#content-body {
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment