Explore 100's Of Free Video Tutorials

Keep Learning, Keep Coding & Keep Sharing

Adding multiple whitespaces

Notes:

HTML - White Space :
When we open our HTML page in any browser. Browser will interpret and execute our HTML code from "left to right" and from "top to down" sequentially.
Open tag and closing tags tell to browser where to start and where to end which section.
If we have more than one blank spaces in between the text, then browser collapses all those white spaces or blank spaces to a single white space or blank space. Hence To get more control over the design of a webpage, it is important to understand, "how browsers interpret and execute our html code".
To add more than one white spaces use html entity:  

Example code:

<html>
<head>
<title>HTML white space</title>
</head>
<body>
HTML &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTML!
</body>
</html>

Interview Questions:

1. Which html entity used to display more than one white space?
a. &sbnp
b. &ndsp;
c. &nbsb;
d. &nbsp;
Answer: d