Learning HTML
Chapter 1 - Introduction to HTML

1.4 Basic HTML Tags

The tags used by HTML are essential to the display of your document by a Web browser. The browser relies on tags for all aspects of document display, including paragraph breaks. For example, you may have a text file which looks like this:

In-state tuition (per credit):
      Undergraduate courses: $134.00
           Graduate courses: $179.00
Without any HTML tags, that text would be displayed by a browser as a single line:

In-state tuition (per credit): Undergraduate courses: $134.00 Graduate courses: $179.00

The tag <P> , however, can be used to create a paragraph break. Formatting the text with this tag

   In-state tuition (per credit):<P>
      Undergraduate courses: $134.00<P>
           Graduate courses: $179.00<P>

would cause it to appear as:

In-state tuition (per credit):

Undergraduate courses: $134.00

Graduate courses: $179.00

Notice that paragraph breaks create a blank line between paragraphs. To create a line break without a blank line, use the <BR> tag:

   In-state tuition (per credit):<BR>
      Undergraduate courses: $134.00<BR>
           Graduate courses: $179.00<BR>

This appears as:

In-state tuition (per credit):
Undergraduate courses: $134.00
Graduate courses: $179.00

You should notice, too, that any spacing is ignored by the browser. Multiple spaces are displayed as a single space. We will see later how to control spacing. HTML tags, by the way, are not case sensitive. They can be typed as uppercase (<BR>) or lowercase (<br>) or even a combination (<bR>).

The tags for line or paragraph breaks are single tags and do not require a closing tag. Other types of single tags are used to add horizontal lines (<HR>) or insert images into your document (<IMG>).

Now that you understand some general concepts, you can go on to Chapter 2 to create your first simple HTML document.


Learning HTML
www.dickinson.edu/~dempsey
Last updated 6/8/2001
Copyright © 2001 Paul Dempsey