Tags Explained

HTML Constructs

An HTML document is composed of two main kinds of constructs: elements, also called tags and entities which will be discussed in the section titled Escape Sequences.

Tags

An HTML tag is a signal to the browser that it is to do something more than just display text on the screen in the default font. Tags are instructions embedded directly into the text of the document and are identified by being included in angle brackets (<>). For example, in

the <b> and </b> are tags. The 'b' in the '<>' instructs the browser to turn on bold formatting. The '/b' in the '<>' tells the browser to turn the bold off.

Not all tags are supported by all browsers. If a browser encounter a tag that it does not understand, it will usually be ignored.

Container Tags

The <b> and </b> above are an example of a container tag. The <b> activates the effect (in this case, bold) and the </b> deactivates the effect. The effect is applied to the text that is enclosed between the paired tags. The <b> is known as the opening tag and the </b> is called the closing tag.

Non-container Tags

The second kind of HTML tag is the stand-alone tag. This type of tag has no companion tag and does not enclose text; for that reason you may see it refered to as an empty tag. An example of this type of tag is <br> which forces the browser to insert a line break at the position where the tag is located. No text is actually effected by this tag, so a closing tag is not needed.

Tag Attributes

Each tag has one or more keywords that instruct the browser what it is to do. In the example above, the 'b' in <b> and the 'br' in <br> are keywords. In these cases, the keyword is sufficient to tell the browser what to do. That is not always the case. For example, the top page of this section includes the spinning globe image. Graphics are inserted into the document using the <img> tag. This however, is not enough to tell the browser what to do. For example, the browser needs to know what image file to insert into the document. This is accomplished with the tag:

The 'src' is an attribute that identifies the URL of the image that is to be loaded. Attributes modify or expand the effects of a tag giving the browser further instructions.


Document Tags

HTML

Syntax:


HEAD

Syntax:


TITLE

Syntax:


META


BODY

Syntax:


Horizontal Rule

Syntax:


Text Formatting Tags

Headings

Syntax:


Paragraphs

Syntax:


Lists

Unordered Lists

Syntax:


Ordered Lists

Syntax:


Nested Lists


Preformatted Text

Syntax:


Extended Quotations

Syntax:


Addresses

Syntax:


Forced Line Breaks

Syntax:


Postal Addresses


Center

Syntax:


Font

Syntax:


Non-breaking Space

Syntax:


Comments

Syntax:


Character Formatting


Logical vs Physical Styles


Escape Sequences


Continue to next page
Return to index page