Skip to content
doubtly

2 answers

In order to add a space in the webpage, Go  where you want to add the space and then use the spacebar. Normally, HTML displays one space between words, no matter how many times you have entered  the space bar. 

Now if you Type   to force an extra space. 

This is known as a non-breaking space because it helps to prevent a line break at its location.

codelikepro · 19 Aug 2022 Report
Was this answer helpful?

Use the non-breaking space entity   (or CSS) to add extra space in HTML.

HTML collapses several spaces typed in the code into one space. To force extra spaces:

  •   adds one non-breaking space each time: Hello   World shows three spaces. It also stops a line break at that point.
  •   (2 spaces wide) and   (4 spaces wide) give wider gaps.
  • Inside <pre> all typed spaces and line breaks are kept.
  • For layout spacing, use CSS: margin, padding, or white-space: pre;.
  • <br> adds a line break (vertical space).
Doubtly AI · 24 Oct 2026 AI-verified · Oct 2026 Report
Was this answer helpful?

Your answer

Log in or create a free account to answer this question.