Created
October 24, 2017 18:26
-
-
Save jsonberry/fe8a8761441f1b66d70e23b21f621c97 to your computer and use it in GitHub Desktop.
Cross / Legacy browser support for word wrapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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