I have seen  
in html and can't quite tell what it does other than create some whitespace. I am wondering what exactly it does and when it should be used?
Use a semicolon to join two related independent clauses in place of a comma and a coordinating conjunction (and, but, or, nor, for, so, yet). Make sure when you use the semicolon that the connection between the two independent clauses is clear without the coordinating conjunction.
The semicolon is used when connecting two sentences or independent clauses. Unlike the comma, you do not use coordinating conjunctions, e.g., and, or, but, etc. A semicolon can also be used when connecting two independent clauses with conjunctive adverbs, e.g., however, therefore, thus, otherwise, etc.
Colons (:) are used in sentences to show that something is following, like a quotation, example, or list. Semicolons (;) are used to join two independent clauses, or two complete thoughts that could stand alone as complete sentences.
(it should have a semi-colon on the end) is an entity for a non-breaking space.
Use it between two words that should not have a line break inserted between them by word wrapping.
There is a good explanation about when this is appropriate grammar on the English StackExchange.
It is sometimes abused to create horizontal space between content in web pages (since it will not collapse like multiple regular spaces). Padding and margins should usually be used instead of this hack.
One reason for
is to insert multiple spaces in a document.
In HTML, multiple whitespace characters are collapsed into one space. This includes tabs and newlines.
IF you wanted to display the following:
three spaces.
You could insert 3
entities instead of using spaces like so:
three spaces.
Edit: It's worth mentioning that
is more of a historical artifact than anything else. Just about every use for it that is mentioned in the answers to this question has a better alternative means to accomplish that goal. However,
is still with us, and these are some of the things people have used it for.
See also: http://www.sightspecific.com/~mosh/www_faq/nbsp.html
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