Notice that I indented the beginning of this paragraph. Remember that your browser normally prints text left justified and only leaves one space between words and sentences. To force extra spaces or simply to indent a line, use the following command. It works.
These six characters will create a space as if you pressed the space bar. I used 8 of them to indent this paragraph as in:
These six characters will ...
In , the nbsp stands for non-breaking space character. is simply known as the space character. How many of these non-breaking space characters you use in a row is up to you. Use whatever number suits your purpose. Note that the "nbsp" must be inlower case letters. &NBSP; will not work. The character "&" is pronounced "ampersand" and these 6 characters form an ampersand command. We know that browsers read commands inside angle brackets (< >). Well, browsers also read commands between the "&" and ";" (that is, between the ampersand and semicolon). Ampersand commands are used to create special characters not found on the keyboard such as the copyright symbol, the trademark symbol, the symbol for degrees, etc. All you need to know is that special code that goes between the "&" and the ";".
Here are some popular symbols and their ampersand commands that work in all browsers (commands for subscripts and superscripts are covered in Lesson 17):
If all you want to do is indent a line or paragraph, using the ampersand command is quite simple. But the ampersand command can also be cumbersome to work with. For example, try the following first problem for this lesson.
Problem 1:SWITCH to NOTEPAD and make up an HTML document that gives the following output in your browser. Indent my address 10 spaces (10 commands) from the left side of the screen, and use 30 spaces between the "n" in Hamlin and the "W" in William. Do the best you can to line everything up. The answer is given in the answer section at the end of this lesson
Mr. Hamlin William Somebody
Continue to HTML Tables