Skip to content

Instantly share code, notes, and snippets.

@krabello
Last active November 28, 2020 21:54
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 krabello/f21e48d5dff9d066446ad1d8e7fce07a to your computer and use it in GitHub Desktop.
Save krabello/f21e48d5dff9d066446ad1d8e7fce07a to your computer and use it in GitHub Desktop.
Line Clamp Example
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.clamp {
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;
word-break: keep-all;
}
</style>
</head>
<body>
<div class="post">
<h2>Heading Post</h2>
<p class="clamp">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard
dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen
book. It has survived not only five centuries, but also the leap into electronic typesetting.</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment