A
character is a space which doesn't allow for line breaking.
<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> <!-- put char here ^ and here ^ --> |foo supercalifragi | |listicexpiali | |docious bar | or with wider size: |foo supercalifragilisticexpiali | |docious bar |
I'm aware of the soft-hyphen character, but for my purposes, I specifically do not want a hyphen added at the break.
In CSS property padding and margin can be used to tab space instead of non-breaking spaces (nbsp).
Non-breaking spaces, also known as no-break, non-breakable, hard or fixed spaces, are characters that look exactly like regular spaces. You cannot see the difference between a non-breaking space and a regular space either on the page or on most screens.
A non-breaking space prevents line breaks from occurring at a particular point in an HTML document. To use a non-breaking space, you would use the following: For example, if you wanted the words "Mr."
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.
You want the unicode character ZERO-WIDTH SPACE (\u200B).
You can get it in HTML with ​
or ​
.
Explicit breaks and non-breaks:
LB7 : Do not break before spaces or zero width space.
LB8 : Break before any character following a zero-width space, even if one or more spaces intervene.
http://unicode.org/reports/tr14/
There also is the little-known wbr tag, which lets the browser to decide whether to break the line or not.
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