Skip to main content

Whitespace and  

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 :

output-1

Manually Add Spaces in HTML Code​

If you can Manually add empty spaces in your HTML code then you can use one Special Character &nbsp; . &nbsp; 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 &nbsp; special character.

Code :

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

Output :

output-2