What's the opposite of a nbsp?
You want the unicode character ZERO-WIDTH SPACE (\u200B).
You can get it in HTML with
or
.
Explicit breaks and non-breaks:
LB7 : Do not break before spaces or zero width space.
LB8 : Break before any character following a zero-width space, even if one or more spaces intervene.
http://unicode.org/reports/tr14/
Breaking space (opposite of non-breaking space)
is a regular space (by its numeric ASCII value).
HTML opposite of non-breaking space
Maybe the Unicode zero-width space would help: http://www.fileformat.info/info/unicode/char/200b/index.htm
The HTML entity is
e.g.overflow
will break the word between "over" and "flow" only when the full word doesn't fit.
Are there other whitespace codes like   for half-spaces, em-spaces, en-spaces etc useful in HTML?
Yes, many.
Including, but not limited to:
- [ ] hair space :
 
- [ ] 6-per-em space :
- [ ] narrow no-break space :
- [ ] thin space :
- [ ] 4-per-em space :
 
- [ ] non breaking space :
- [ ] punctuation space :
 
- [ ] 3-per-em space :
 
- [ ] en space :
- [ ] figure space :
 
- [ ] em space :
span{background-color: red;}
<table>
<tr><td>non breaking space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>narrow no-break space:</td><td> <span> </span></td></tr>
<tr><td>en space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>em space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>3-per-em space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>4-per-em space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>6-per-em space:</td><td> <span> </span></td></tr>
<tr><td>figure space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>punctuation space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>thin space:</td><td> <span> </span> or <span> </span></td></tr>
<tr><td>hair space:</td><td> <span> </span> or <span> </span></td></tr>
</table>
How to keep   without empty space?
In CSS, try:
white-space:break-spaces
Tab character instead of multiple non-breaking spaces (nbsp)?
It's much cleaner to use CSS. Try padding-left:5em
or margin-left:5em
as appropriate instead.
Difference between and
is the classic space, the one you get when you hit your spacebar, represented by his HTML entity equivalent.
and
represents the non-breaking space, often used to prevent collapse of multiple spaces togethers by the browser :
" "
=> " " (collapsed into only one space)
" "
=> " " (not collapsed)
If you are parsing a string containing both classic and non-breaking spaces, you can safely replace one by the other.
What is and does it affect perfomance of a webpage?
It is a character entity for a non-break space.
It means that it the space will not be collapsed when viewed in a browser (as whitespace is normalized and ignored in HTML).
The only proper use of it is to ensure that certain words will not wrap (if you always want them to appear on the same line). For example Open University
- will not wrap.
It doesn't effect performance, apart from the added characters that get transmitted.
In earlier times, before CSS was widely used,
s were used in conjunction with tables for layout. These days, you should use CSS for layout.
Tab character instead of multiple non-breaking spaces (nbsp)?
It's much cleaner to use CSS. Try padding-left:5em
or margin-left:5em
as appropriate instead.
Related Topics
How to Change Font in Ipython Notebook
CSS Right Margin Does Not Work Inside a Div with Overflow Scroll
HTML List Isn't Vertically Aligned When Using Floating Images
How to Remove This Horizontal Scrollbar in Bootstrap 3
Why Don't Svg Images Scale Using The CSS "Width" Property
How to Style HTML5 <Meter> Tag
<Ol> with Numbers Another Color
Text-Align: Right on <Select> or <Option>
CSS: How to Create a Gap Between Rows in a Table
How to Use Text-Overflow Ellipsis in an HTML Input Field
What's The Key Difference Between HTML 4 and HTML 5
How to Display The HTML Code of a Webpage in a Batch File
Trying to Align HTML Button at The Center of The My Page
Indent Starting from The Second Line of a Paragraph with CSS
Remove Microsoft Edge's Phone Number Styling
What Does an Entry "Action=''" in HTML Form Mean
Object-Fit Not Affecting Images
How to Create a 100% Screen Width Div Inside a Container in Bootstrap