βšͺ

&nbsp (HTML)

Category
HTML
Tags
πŸ§‘β€πŸ’»Code
βšͺ
Definition: &nbsp is an HTML character entity reference for a non-breaking space. A non-breaking space is a space that will not be broken over two lines.

The &nbsp entity is one of the most common character entity references used in HTML.

When you use the &nbsp entity, the characters that follow it are not allowed to break onto a new line.

This is useful for things like addresses, where you might want the city and state to stay on the same line as the street address.

In HTML, &nbsp is also known as the "hard space" or "non-breaking space."

It is different from the "normal" space you create when you hit the space bar. The normal space will break if it comes to the end of a line, but the &nbsp will not break.

To visualize this, think of the &nbsp as a "glue" that keeps words and other characters together.

The &nbsp is also used as a way to create extra space between text or other elements on a web page.