I know that there is a non breaking whitespace -
. Is there a non-breaking dash (-
) I can use so that my word doesn't wrap (break) at that location. Also can someone point me to a list with characters that are considered with priority when breaking a sentence ( like a whitespace). Thanks in advance :)
To add real spaces to your text, you can use the character entity. Tip: The non-breaking hyphen (‑) is used to define a hyphen character (‑) that does not break into a new line.
Insert a nonbreaking hyphen Click where you want to insert the nonbreaking hyphen. On the Insert tab, in the Symbols group, click Symbol. In the box that opens, click More Symbols. In the Symbol dialog box, on the Special Characters tab, click the Nonbreaking Hyphen row to highlight it, and then click Insert.
After typing/inserting the en dash, go to Insert and then Symbols and select Special Characters and choose No-Width Non Break. If you need it regularly you can assign a shortcut to it.
You can use ‑ which is a Unicode NON-BREAKING HYPHEN (U+2011).
Use ‑
instead of -
, see the following example:
.box {
border:1px solid #000;
width:40px;
word-wrap:normal;
}
<div class="box">
This is a test‑case / test-case
</div>
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