Skip to content

Instantly share code, notes, and snippets.

@trey
Last active September 15, 2016 02:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save trey/7abe6aee810d6f8c420d to your computer and use it in GitHub Desktop.
Truncate a String in CSS

Truncate a String in CSS

.whatever {
  max-width: [?]px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* optional */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment