161k views
4 votes
Browsers remove extra spaces when displaying an HTML file. a) True b) False

1 Answer

4 votes

Final answer:

Browsers do remove extra spaces when displaying an HTML file. This is referred to as 'whitespace collapsing'. One can use certain HTML entities or tags to display multiple spaces if needed.

Step-by-step explanation:

The statement that browsers remove extra spaces when displaying an HTML file is true. When writing HTML code, we can sometimes add extra spaces or new lines for readability. However, browsers interpret any amount of whitespace (spaces, tabs, or new lines) beyond a single space as just one space. This is called 'whitespace collapsing'. If you need to display multiple spaces, you can use the HTML entity or

tag.

User Manny Fitzgerald
by
7.3k points