For a complete list of How To's follow this link.
If you're looking for something else,
check out the LABELs drop down menu.

Monday, August 14, 2006

How to: Insert a Non Breaking Space

Did you know that if you want to insert a blank space between text or pictures, it doesn't matter how many times you hit the space bar, the browser will only read one space. You could hit the spacebar 10 times between one word and the next, and the browser will still only read one space.

I can't explain the technical reasons behind this. But what I can tell you is that if you want to insert more than one blank space between text or pictures on your blog or your template, you need to insert a 'Non Breaking Space' or 'nbsp;'. I can't type the correct code here as you will only see a blank space, so I've inserted the code as pictures above.

I used two nbsp between the first & second picture below and four between the second & third picture below to demonstrate how you can use non breaking spaces.

Drawing of fruit bowl and felt pin cushion  Felted bags, Knit bag & Amigurumi Amineko    Liesel scarf & Lengthways scarf

Why not try it out yourselves.

Best wishes...Bernie


alliesw said...

Gosh, thanks for this. I can't tell you how many times I've hit the space and return bars while working on my template and nothing! Can't wait to try it!

Yvonne said...

Not sure if this will work or if Blogger will mess up the code, but in order to type an ampersand, you should type the ampersand, and then amp;


So to type out the full code for a non-breaking space, you can type


And it should show up without converting it to the non-breaking space.

The reason for this is that an ampersand has a special code-meaning, and in order to get it to show up as regular text, we need to signal to the browser that we want it to be text, and not to give it it's code-meaning. We do that by typing &. This is called "escaping" a character in programmer-speak.