How to insert spaces/tabs in text using HTML/CSS

To insert tab space between two words/sentences I usually use

  and  


In cases wherein the width/height of the space is beyond   I usually use:

For horizontal spacer:

<span style="display:inline-block; width: YOURWIDTH;"></span>

For vertical spacer:

<span style="display:block; height: YOURHEIGHT;"></span>

You can use &nbsp; for spaces, &lt; for < (less than, entity number &#60;) and &gt; for > (greater than, entity number &#62;).

A complete list can be found at HTML Entities.


Try &emsp;.

As per the documentation at Special Characters:

The character entities &ensp; and &emsp; denote an en space and an em space respectively, where an en space is half the point size and an em space is equal to the point size of the current font. For fixed pitch fonts, the user agent can treat the en space as being equivalent to A space character, and the em space as being equivalent to two space characters.


Types of Spaces in HTML

Creates four spaces between the text- &emsp;

Creates two spaces between the text - &ensp;

Creates a regular space between the text - &nbsp;

creates a narrow space ( similar to regular space but slight difference - "&thinsp";

spacing between sentences - "</br>"

This link might help you. Check out [https://hea-www.harvard.edu/~fine/Tech/html-sentences.html]