I have long namespaces to be displayed in my articles (like MyProject\Sub\Level) and I want them to be wrapped on a backslash character (\) if the window width is insufficient. How can I implement this using CSS or JS/jQuery?
I have long namespaces to be displayed in my articles (like MyProject\Sub\Level ) and
Share
To tell browsers that a line break is permitted after a character, insert the ZERO WIDTH SPACE (ZWSP) character, U+200B, after the character. In HTML markup, you can use the character reference `’, e.g.
If you add the characters via scripting, you can enter the character itself, using the string literal
\u200b.Some old browsers (IE 6) used to have problems with this, but now this approach seems to work better than the alternative, the old
<wbr>tag (which was well-supported but has now been messed up in new versions of IE).