How to imitate word-break: break-word; for IE9, IE11 and Firefox?
It seems to work in Chrome. I found out and realized that this is a non-standard, webkit.
FYI, I tried to use
white-space: pre-wrap;
And a bit more,
overflow-wrap: break-word;
Also tried the CSS below,
word-wrap: break-word; word-break: break-word;
But they do not seem to work.
I cannot provide a fixed range width (which contains text) by making it display: block; explicitly, since the text is dynamic and will differ depending on the geographic location of the user. We currently support about 18 languages.
This is what the code looks like,
html
<div id="grid2"> <span id="theSpan">Product Support</span> </div>
CSS
#theSpan{ white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word; word-break: break-all; } #grid2{ width: 100px; }
Looks like,

I want it to be

Note:
I had to use word-break: break-all; because for some languages ββthe translated text is too long and it overflows from the grid. The text "Product Support" is dynamic.
Update:
I have a fixed width for a div with id, grid2. In one of the languages, the translated text is too long, this is one word, and it follows from the grid2 div.
Updated code.
source share