nbsp

Small but significant

This is something that many people, fluent in HTML or not, don’t know. They go through their lives programming away, using it in every chunk of copy they add to sites, without knowing the true potential of its use. It’s been around since the beginning of time (and by time I mean the birth of html) it’s the underrated and misused Non-Breaking Space ( ).

I have to be honest with you, I am one of them. I had no idea of the true potential until the other day and I believe it’s my duty, as Web Developer, to tell the world.

So here’s the issue, your client just sent you a word document containing a few paragraphs. Within said paragraph there’s a date, 24 December 2011. You copy the text from the file, paste it into your containing div and carry on with life as you know it. Problem is your client has OCD or something that is preventing them from leaving this tiny line break alone. Here’s how the copy looks:

Here at Ma and Pa’s Shop For Shingles we have a running sale starting on 24 December 2011. Buy 1 box of shingles and we’ll throw in a house! *house size may vary

They send you an email asking you to please make sure the date is not separated by a line break. So you go in, add a <br /> just before the date and move on, right?… Wrong. Well not entirely wrong, that is one way of going about it, but if your site is fluid and gets resized to fit the screen, you’ll have random line breaks scattered throughout your copy. Here’s the solution, the &nbsp; that you use for random spacing, this is where it shines.

Instead of:

<br />24 December 2011

Drop this baby in:

24&nbsp;December&nbsp;2011

Now the date will never be apart and can live happily ever after. And your fluid site won’t show random line breaks on smaller or larger screens.

Keep that in mind the next time you call the &nbsp; useless or any other demeaning name.

Leave a Comment