Rules
Terms of Use

Topic Options
#197724 - Fri Oct 17 2003 10:56 AM &nbsp
achernar Offline
Prolific

Registered: Fri Jun 06 2003
Posts: 1336
Loc: Mumbai India                  
On several websites, I see this bit of gobbledygook written: &nbsp. Now I have no idea what it does and why it is there, so could somebody please explain? Is it something like the code for the ampersand (&)?

Thank you!

Top
#197725 - Fri Oct 17 2003 11:03 AM Re: &nbsp
Linda1 Offline
Star Poster

Registered: Thu Sep 30 1999
Posts: 11250
Loc: Munchkinland
See this for your answer.

_________________________
Cats know what we feel. They don't care, but they know.

Top
#197726 - Fri Oct 17 2003 02:30 PM Re: &nbsp
tellywellies Offline
Forum Champion

Registered: Sat Apr 13 2002
Posts: 5473
Loc: South of England
Below is a practical use of   (the non breaking space):

wribfast.html">Bad&nbsp;breakfast</a> | Budgie | <a href="
wricannibal.html">Cannibal</a> | C<a href="
wrichequecard.html">heque&nbsp;card</a>&nbsp;| <a href="
wridisgruntled.html">Disgruntled</a> | &nbsp;<a href="
wrivampire.html">Fang&nbsp;cue</a>&nbsp;| <a href="
wrihintshoax.html">Hints&nbsp;&amp;&nbsp;hoaxes</a> | &nbsp;<a href="
wrifology.html">I.F.O</a> | <a href="
wrilobster.html">Lobster</a> | <a href="
wriprayer.html">My&nbsp;prayer</a> | <a href="
wrinews.html">Newsflash!</a> | <a href="
wrispecs.html">SunnySpecs</a> | <a href="
wridentist.html">Teef&nbsp;grief</a> | <a href="
writents.html">Tents</a> | <a href="
wrihelpinghand.html">The&nbsp;helping&nbsp;hand</a> | <a href="
writower.html">The&nbsp;tower</a> | &nbsp;<a href="
wrirecipe.html">Recipe</a></span></p>

This is the code behind a menu in one of my web pages. Notice that &nbsp; is used in between the words of any two-worded titles such as The Tower (near the bottom). Without &nbsp; between them, the title might appear on two lines (known as 'wrapping') and appear as The
Tower
.

The above menu's appearance and the benefits of using &nbsp; can be seen at the bottom of this page. Try resizing the Browser Window. No matter what size the Window is, none of the two-worded titles will break up. The same applies if screen resolutions are switched

&nbsp; should always be invisible in all Browsers though. The only reason I can think of why it would be seen in a page is if some text were copied from page code then pasted into a WYSIWYG web editor as a paragraph. Perhaps the odd &nbsp; might slip in unnoticed.
_________________________
Error: Keyboard not attached. Press any key to continue..

Top
#197727 - Fri Oct 17 2003 07:12 PM Re: &nbsp
achernar Offline
Prolific

Registered: Fri Jun 06 2003
Posts: 1336
Loc: Mumbai India                  
Thank you, Linda and TW, for explaining that to me!

I think I now know the reason why I sometimes see it appear on the web-page. It's because of careless code-writing on the part of the web-page designer! It appears simply because they've forgotten the semi-colon ; and the end of the &nbsp! And so instead of &nbsp;, they've inputted &nbsp, without the semi-colon!

(And by the way, TW, I like your budgie-care page!)


Edited by harish_256 (Fri Oct 17 2003 11:09 PM)

Top
#197728 - Fri Oct 17 2003 11:08 PM Re: &nbsp
tellywellies Offline
Forum Champion

Registered: Sat Apr 13 2002
Posts: 5473
Loc: South of England
Quote:

they've inputted &nbsp, without the semi-colon!



Ah yes, that would do it!
_________________________
Error: Keyboard not attached. Press any key to continue..

Top

Moderator:  flopsymopsy, ladymacb29