HTML Lessons  

  1. HTML Introduction

  2. HTML Tags

  3. HTML Page Structure

  4. HTML Backgrounds

  5. HTML Formatting Text

  6. HTML Formatting Fonts

  7. HTML Headings

  8. HTML Entities

  9. HTML Line Breaks

  10. HTML Lists

  11. HTML HR- Horizontal Rule

  12. HTML Images

  13. HTML Links

  14. Table Introduction

  15. Table Rows & Columns

  16. Table Width

  17. Table Alignment

  18. Table Border Color

  19. Table Background Color

  20. Table Background Image

  21. Cell Alignment

  22. Cell Padding

  23. Cell Spacing

  24. Cell Spanning

 

Line breaks and spaces

By default it doesn't matter how your text appears in your text editor. Internet explorer will ignore all line breaks and extra spaces.  If you want line breaks you will need to include a tag for it.

For example if you were to type the following into your notepad file.

<body>
I
Love
HTML.
</body>

The result would be:

I Love HTML.

This is because the browser will ignore any line breaks you have entered into the code. If you want a line break you will have to insert a tag for it, like so:

<body>
I<br>
Love<br>
HTML.
</body>

Now the result will be:

I
Love
HTML.

Let's say you wanted an even bigger line break. Then you would use the <p> tag. This lets the browser know that a new paragraph will begin. The <p> tag is the equivalent of two <br> tags.

For example the following code:

<body>
I<p>
Love<p>
HTML.
</body>

Will appear as:

I

Love

HTML.

The <br> and <p> tag do not need closing tags.

We can use the align attribute to control the alignment of paragraphs. For example:

<p align="right">This paragraph is aligned right.
<p align="center">This paragraph is aligned center.
<p align="left">This paragraph is aligned left.

Will appear as:

Browsers also ignore extra spaces. To add an extra space add the tag &nbsp;. This tag is an example of a tag that does not have a less than and greater sign.

The following code:

<body>This code has ten          extra spaces.</body>

Would appear as:

This code has ten extra spaces.

Notice how the result ignored any extra spaces that were typed.

To insure the spaces will appear, you must insert a &nbsp; tag for every space, like so:

<body> This code has ten &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extra spaces.</body>

A very helpful tag is the <pre> </pre> tags.  These tags will not ignore all line breaks and extra spaces from your text editor.  Here's an example:

<pre>This text will appear

 

like so.

</pre>

The result would be:

This text will appear

 

like so.

 

Next Lesson

© Copyright Studio6000 2006. All rights Reserved.