In my HTML I have a very long word and I'm trying to force a specific break point only when there isn't enough room. What I need is a sort of conditional-breaking placeholder. How can I achieve this sort of thing?
<p>lorem ipsum here are some words and so on</p> | lorem ipsum | | here are some words and so | | on | What's the opposite of that? That is, a character which is NOT rendered as a space, but CAN be used for line breaking. <p>foo supercalifragilisticexpialidocious bar</p> <!--
Alternatively called a fixed space or hard space, NBSP (non-breaking space) is used in programming and word processing to create a space in a line that cannot be broken by word wrap. With HTML, lets you create multiple spaces that are visible on a web page and not only in the source code.
A commonly used entity in HTML is the non-breaking space: A non-breaking space is a space that will not break into a new line. Two words separated by a non-breaking space will stick together (not break into a new line).
Maybe the Unicode zero-width space would help: http://www.fileformat.info/info/unicode/char/200b/index.htm
The HTML entity is ​
e.g. over​flow
will break the word between "over" and "flow" only when the full word doesn't fit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With