Skip to content

Instantly share code, notes, and snippets.

@codfish
Created October 24, 2013 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codfish/7129742 to your computer and use it in GitHub Desktop.
Save codfish/7129742 to your computer and use it in GitHub Desktop.
"-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