While solving a little bug on a website caused by a non-breaking space (
) I was wondering if there's an opposite.
Is there an HTML code for a breaking space, and if so, what is it?
I saw mention in this question about a zero-width space (​
), but that won't give any width (obviously).
Does an HTML entity exist for a regular space?
Recently, I needed the opposite of - instead of a non-breaking space, I needed a breaking non-space. Luckily, there's a Unicode character that fits this description: it's named the ZERO-WIDTH-SPACE character. When the browser goes to wrap a line, it offers itself up as a valid line-wrap location.
Your word processor assumes that a word space marks a safe place to flow text onto a new line or page. A nonbreaking space is the same width as a word space, but it prevents the text from flowing to a new line or page. It's like invisible glue between the words on either side.
In word processing and digital typesetting, a non-breaking space, , also called NBSP, required space, hard space, or fixed space (though it is not of fixed width), is a space character that prevents an automatic line break at its position.
In CSS property padding and margin can be used to tab space instead of non-breaking spaces (nbsp).
 
is a regular space (by its numeric ASCII value).
If you are using HTML and you would like more than one space to to appear, will not work. The unfortunate part about is it does not wrap properly because it is a non-breaking space.
For those that reached here looking for a solution, try the CSS
white-space: pre-wrap;
This will allow you to have multiple spaces side by side in a single line. It works great for chat programs.
There are multiple html entities for regular white space, which allow breaking, for instance  
Read this article for more information: https://www.codetd.com/en/article/6915972
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With