HTML & CSS Introduction
Course Content

Non-breaking Space –  

A non-breaking space ( ) is an HTML entity that is used as a replacement for space.

Why is non-breaking space ( ) needed?

HTML doesn't recognize more than one space. Even if you hit multiple spaces, when you open the HTML document with a browser, you won't see more than one space.

For example, the code below has multiple spaces under the <p> tag; however, the multiple spaces are not rendered in the browser.

How multiple spaces in a HTML document are displayed in a browser

How does non-breaking space (&nbsp;) work?

A set of &nbsp; (non-breaking space) in a text line creates multiple spaces like in the example below.

How non-breaking space works