Skip to main content

Whitespace and &nbsp

Whitespace

Whitespace are more than one single space. This are the blank inserted after a single spaces or multiple spaces enterd in the line. By default, HTML considers multiple spaces as a single space, and the browser ignores excess whitespace.

code

<!DOCTYPE html>
<html>
<head>
<title>Basic Tags</title>
</head>
<body>
Hello Students👋, Good Evening
</body>
</html>

output

Manually Add Spaces in HTML Code

If you can Manually add empty spaces in your HTML code then you can use one Special Character   .   means Non-breaking Space. If you write 5 spaces in your code, the browser will remove them. To add empty spaces manually to your code, you can use the   special character.

<html>
<head>
<title>Basic Tags</title>
</head>
<body>
Hello Students👋, Good &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Evening
</body>
</html>

output