Search code examples
htmllayouttypography

How to create small SPACES in HTML?


There is em dash and en dash. Is there an "en" equivalent to   ? Is there an en equivalent to pure Ascii 32?

I want a better way to write this:

123<span class="spanen">&nbsp;</span>456<span class="spanen">&nbsp;</span>789

or this:

123<span class="spanen"> </span>456<span class="spanen"> </span>789

Solution

  • Don't use hacks that make no sense. If you wish to separate some words, I suggest you use the CSS property word-spacing:

    .strangeNumbers {
      word-spacing: 0.5em;
    }
    <span class="strangeNumbers">123 456</span>