So I have the text e-commerce
and I don't want the line to wrap at the dash.
How would I restrict wrapping for that text line?
The answer to this dilemma is to use non-breaking hyphens instead of regular dashes when you don't want Word to break a line at the hyphen. To do this, hold down the Ctrl and Shift keys as you type the dash (this is the same as typing Ctrl and an underscore). Word will then not break the line at that point.
There are several ways to prevent line breaks in content. Using is one way, and works fine between words, but using it between an empty element and some text does not have a well-defined effect. The same would apply to the more logical and more accessible approach where you use an image for an icon.
In HTML, use ­ to insert a soft hyphen.
You could use CSS: white-space: nowrap;
.
Example: Wrap the text in a span with that CSS declaration.
<span style="white-space: nowrap;">e-commerce</span>
Use the non-breaking hyphen: ‑
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