Skip to content

Instantly share code, notes, and snippets.

@jsonberry
Created October 24, 2017 18: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 jsonberry/fe8a8761441f1b66d70e23b21f621c97 to your computer and use it in GitHub Desktop.
Save jsonberry/fe8a8761441f1b66d70e23b21f621c97 to your computer and use it in GitHub Desktop.
Cross / Legacy browser support for word wrapping
.container {
word-wrap: break-word; // works for IE11, IE10
overflow-wrap: break-word; // New naming for word-wrap attribute, keep for possible deprecation of word-wrap
word-break: break-word; // Helps with non English character wrapping, supported by Blink based browsers
.item {
// display: block or inline-block may be required
max-width: 250px;
width: 100%; // Allows for word wrap in IE10/IE11
@supports (display: flex) {
// Progressgive Enhancement
// Allows for evergreen browsers to keep variable sizing, with a max
// Good for something like a chat message
width: inherit;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment