Skip to content

Instantly share code, notes, and snippets.

@craigbutcher
Created August 10, 2015 08:26
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 craigbutcher/0f02a1fa253cd7ab796c to your computer and use it in GitHub Desktop.
Save craigbutcher/0f02a1fa253cd7ab796c to your computer and use it in GitHub Desktop.
Truncate String with Ellipsis
/*
* Accessibility wise, it may bring up various issues.
*
* Long file names with similar names, for example:
*
* + Gauntlet I - In The Beginning - becomes - Gauntlet I
* + Gauntlet II - In The Middle - becomes - Gauntlet I...
* + Gauntlet III - In The End - becomes - Gauntlet I...
*
* The only way to overcome this is to either produce shorter titles
* or redesign/rethink the presentation layout.
*
*/
.truncate {
width: 250px;
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