Skip to content

Instantly share code, notes, and snippets.

@mayognaise
Last active July 13, 2023 23:56
Show Gist options
  • Save mayognaise/cbf2cf830ed06fc639ba057c2ea58b0f to your computer and use it in GitHub Desktop.
Save mayognaise/cbf2cf830ed06fc639ba057c2ea58b0f to your computer and use it in GitHub Desktop.
Clamp for multiple lines (three dots when text is too long)
.line-clamp {
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* max line length */
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment