HTML Space Code

There are multiple ways to insert spaces between the words or characters:

Using Spacebar

To add a space between the words, first we have to click where we want to add a space and then press space bar. The HTML document use only one space between the words. In simple words, if we press spacebar more than one time, then it will show only one space between the words on the browser as described in the following example:

Example

<head>  

<title>  

 Example of space   

</title>  

<head>  

<body>  

JavaT   Point  

</body>  

</html>

In this example, we press the spacebar more than one time, but the following output shows only one space between the JavaT and Point.

Using &nbsp;

The &nbsp; is a non-breaking space that is used in the HTML document. It is most commonly used method for spacing, which prevents a line from breaking. The following example determines how to use  :

Example

<html>  

<head>  

<title>  

 Example of space   

</title>  

<head>  

<body>  

JavaT  &nbsp; &nbsp; &nbsp; &nbsp;  Point  

</body>  

</html>

Output:

HTML Space Code

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *