Html blank space usage


Home - Tutorials - Basics

Detailed description how to use HTML blank space entity to display more space characters in your text.

Tutorial info:


Name:Html blank space usage
Total steps:1
Category:Basics
Date:2010-09-23
Level:Beginner
Product:See complete product
Viewed:8392

Bookmark Html blank space usage



AddThis Social Bookmark Button

Step 1 - The HTML blank space usage


Html blank space usage

For newbies in HTML development it is usually a very annoying discovery that browsers always truncate spaces. So it makes no difference if you put a single space between two words or twenty as you can see in the following examples:

Code:
  1. word1 word2<br/>
  2. word1          word2<br/>

And the output is:

Output:
  1. word1 word2
  2. word1 word2

Fortunately there is a simple solution to the blank space problem. Using the special html code (html entity) &nbsp; which is the code of the non breaking space. Using this you can add as many space as you want between two item. Let’s see the above example again but in this time with using the non breaking space entity instead of simple spaces:

Code:
  1. word1 word2<br/>
  2. word1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;word2<br/>

Which results the following output:

Output:
  1. word1 word2
  2. word1          word2

Note: To build your layout structure use CSS positioning instead of   codes.






Tags: html blank space, text space, blank tag, space character

Html blank space usage - Table of contents
Step 1 - The HTML blank space usage


Host Addon Ltd

F1 Site Family
AJAX F1
CSS F1
Database F1
Flash F1
HTML F1
Java F1
JavaScript F1
PhotoShop F1
PHP F1
Scripts F1
Tutorial F1
Windows F1

Total time: 0.029