Skip to content

Instantly share code, notes, and snippets.

@bryandh
Created October 26, 2017 11:17
Show Gist options
  • Save bryandh/7f846ef0ae8e0074da47ba7200dba1c2 to your computer and use it in GitHub Desktop.
Save bryandh/7f846ef0ae8e0074da47ba7200dba1c2 to your computer and use it in GitHub Desktop.
Truncate text with dots in CSS
.truncate {
width: 250px; // Not required as container's width is usually sufficient
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment