Skip to content

Instantly share code, notes, and snippets.

@tiodot
Last active June 25, 2022 06:07
Show Gist options
  • Save tiodot/7ad02983279f508081a241058bfb2ed6 to your computer and use it in GitHub Desktop.
Save tiodot/7ad02983279f508081a241058bfb2ed6 to your computer and use it in GitHub Desktop.
css text truncate
// single line truncate
.ellipsis {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
// multiline truncate
.ellipsis-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment