<p>What about using CSS <code>white-space: nowrap;</code> instead of <code>&amp;nbsp;</code> characters? I guess that's semantically more correct and this also allows you to prevent your text to break at any other character (great for phone numbers etc.).</p>

<p>CSS:</p>

<pre><code>.nobr {
  white-space: nowrap;
}
</code></pre>

<p>Markup:</p>

<pre><code>&lt;p&gt;my phone number is &lt;span class="nobr"&gt;+1 800-275-8777&lt;/span&gt;&lt;/p&gt;
</code></pre>

<p>To add this easily to your Redactor fields markup, have a look at the <a href="http://imperavi.com/redactor/docs/api/inline/" rel="nofollow">inline format</a> API or the <a href="http://imperavi.com/redactor/docs/settings/formatting/#setting-formattingAdd" rel="nofollow">formattingAdd</a> config setting (I actually had mixed experiences with that setting).</p>

<p>If you'd like to be able to add this with the click of a button, I also just added this to my <a href="https://github.com/carlcs/craft-redactorinlinestyles" rel="nofollow">Redactor Inline Styles</a> plugin, which is a collection of (optional) buttons to apply inline styles to your Redactor texts (Quotes, Code, etc.).</p>

CC BY-SA 3.0
2015-05-19T18:59:08.777Z
2015-05-19T18:59:08.777Z
carlcs
<p>Seems like a basic question but I can’t figure out a way to do this out of the box, or reference to it in the Redactor docs. <code>‘&amp;nbsp;’</code> always gets stripped out.</p>

CC BY-SA 4.0
2019-12-29T20:50:30.323Z
The one-click button seems like a reasonable option. Otherwise, resolving why something gets stripped when it shouldn’t is still an issue. When i’m putting content in markup, I use this same method but we cannot expect the casual content editor to make sure the html it inserts is done properly.
Jeremy
<redactor><richtext>
How to add a non-breaking space to a rich text field?
# How to add a non-breaking space to a rich text field?

(Asked by: username_0 on 2015-05-19)

Seems like a basic question but I can’t figure out a way to do this out of the box, or reference to it in the Redactor docs. `‘ ’` always gets stripped out.

**Tags:** redactor, richtext
> **Comments:**
> **username_1**: The one-click button seems like a reasonable option. Otherwise, resolving why something gets stripped when it shouldn’t is still an issue. When i’m putting content in markup, I use this same method but we cannot expect the casual content editor to make sure the html it inserts is done properly.  

---

## 1 answers

### Answer by username_2 on 2015-05-19. Score: 3 | Accepted answer

What about using CSS white-space: nowrap; instead of   characters? I guess that's semantically more correct and this also allows you to prevent your text to break at any other character (great for phone numbers etc.).
CSS:
.nobr {
  white-space: nowrap;
}

Markup:
my phone number is +1 800-275-8777

To add this easily to your Redactor fields markup, have a look at the inline format API or the formattingAdd config setting (I actually had mixed experiences with that setting).
If you'd like to be able to add this with the click of a button, I also just added this to my Redactor Inline Styles plugin, which is a collection of (optional) buttons to apply inline styles to your Redactor texts (Quotes, Code, etc.).


---

