-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overflow-wrap: break-word #47
Comments
Maybe classify it as secondary or specialized, if at all. I don't recommend using this on anything but carefully selected elements that might contain long strings. URLs are a great use case, so I typically only set this on body text containers and headers. URL strings rarely exist in other places of a UI, which makes setting this on It also has the potential to break even two-letter words (like in buttons). Especially if working with fixed sizes (for some reason). I have seen examples where this and/or |
Thanks for the feedback @halvorsanden. Considering your example (without
|
You're absolutely right about In the case of the fixed button sizes, which I think we can agree on is rarely a good idea, there's probably little difference between overflowing and wrapping a word. Both break the layout in some form and neither looks good. Although a non-breaking word might be a bit easier to read, most people are probably able to piece together the letters of a broken word. And so I agree that |
Personally, I default to use
html { overflow-wrap: break-word; }
(https://www.w3.org/TR/css-text/#overflow-wrap-property) specifically to allow wrapping of long text strings such as displayed URLs. I haven't observed any issues with this, but I can imagine there may be unexpected behavior with mixing certain writing-modes or some such.See this anonymous glitch for a quick demonstration:https://pool-highfalutin-pickle.glitch.me
Demo HTML
Copy & paste to open in a browser:
The text was updated successfully, but these errors were encountered: