Open In App

What is the entity name used for non-breaking space in HTML ?

Last Updated : 16 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The     character entity is used to denote a non-breaking space which is a fixed space. This may be perceived as twice the space of a normal space. It is used to create a space in a line that cannot be broken by word wrap.

If we want to use Two spaces gap, we have to use   and to use four space –   is used.

Syntax:

 

Example 1: In this example, we are using single   to get one space.

HTML




<!DOCTYPE html>
<html>
<body>
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
    <p>This is a   regular space.</p>
</body>
</html>


Output:

 

Example 2: In this example, we are using a single 4 &nbsp; to get four spaces.

HTML




<!DOCTYPE html>
<html>
<body>
    <h1 style="color: green">
        GeeksforGeeks
    </h1>
    <p>This   is a   space    .</p>
</body>
</html>


Output:

 


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads