We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is a Non-Breaking Space?

Mary McMahon
By
Updated: May 16, 2024

A non-breaking space is a space what will be respected in layouts and displays by browsers and computer programs. Generally, simple spaces are treated as places where it is appropriate to place a line break, and multiple spaces may be collapsed by a browser when it displays, for convenience. With a non-breaking space, the space is held. There are a number of settings where this is appropriate and there is an HTML entity, &nbsp, used to code non-breaking spaces into a display.

The concept of the non-breaking space is a carryover from typesetting, where sentence spacing needed to be controlled to prevent awkward problems and for aesthetic reasons. With the development of electronic typesetting, people needed a way to control spaces in specific settings, and this was brought into the Internet as well. Controlling spacing and other elements when text is displayed allows people to customize the appearance of a website and the information presented.

In a simple example of a setting where people might want to use a non-breaking space, there are some things users might not want to see broken with a line break, like a formal title and name, such as “Mr. Jones,” or a measurement, like “16 cups.” Using a non-breaking space will ensure that a line break will not be inserted by a computer program or browser; if there is not enough room for it to fit on one line, it will be dropped to the next line down.

For certain formatting purposes, like poetry, non-breaking spaces can also be useful. People should be careful about using the HTML entity, as some browsers will treat a string of non-breaking spaces as a single space, and may change the formatting. Browsers also display content differently and content that looks acceptable in one browser may look odd in another; forcing white space with non-breaking spaces can result in display errors.

In HTML, non-breaking spaces are sometimes used to create space between visual elements, or to hold cells in a table open. Some browsers have difficulty reading empty cells and may move the elements of a table around, causing problems with layout. Sticking a non-breaking space inside the cell will alert the browser to the fact that the cell is supposed to be displayed as empty.

Many software programs insert non-breaking spaces automatically when they are appropriate, as do some "what you see is what you get" (WYSIWYG) editors used online. These programs use known spelling and grammar conventions to insert hard spaces when it is assumed that the user does not want a line break to appear.

EasyTechJunkie is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Mary McMahon
By Mary McMahon

Ever since she began contributing to the site several years ago, Mary has embraced the exciting challenge of being a EasyTechJunkie researcher and writer. Mary has a liberal arts degree from Goddard College and spends her free time reading, cooking, and exploring the great outdoors.

Discussion Comments
Mary McMahon
Mary McMahon

Ever since she began contributing to the site several years ago, Mary has embraced the exciting challenge of being a...

Learn more
Share
https://www.easytechjunkie.com/what-is-a-non-breaking-space.htm
EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.

EasyTechJunkie, in your inbox

Our latest articles, guides, and more, delivered daily.