Elementary Taxonomy
To ease understanding of HTML, elements are grouped in certain
categories. One of these categories we have already looked at: Document
head elements. These elements can only exist within the
HEAD
element.
The rest of the elements in HTML (except for HTML
,
HEAD
and BODY
) must be contained inside the
BODY
element. These are also grouped into two categories:
block elements and inline elements.
P
is an example of a block element. Block elements
define a block of text or information. They are usually rendered as
separate from other block elements (like paragraphs, that are
traditionally rendered as a block of text with a top and bottom margin).
A
, the anchor element, is an example of an inline
element. Inline elements usually make sense even when they contain only
part of a sentence or phrase. Inline elements are always
contained within block elements.
There are two more distinctions that we can make: some elements can contain elements of the same type as themselves. We have already seen that paragraphs cannot contain other paragraphs. Other elements may contain elements of the same type, however. In this case, we say that the element can be nested. Also, there is a handful of elements that can be used either as inline elements or as block elements. We won't look at any of these in this tutorial, but it's useful to mention here. I'll explain how these are used once we get to see them in action.
As mentioned in the introduction to this tutorial, I won't cover every attribute of the elements that will be introduced. Some attributes are common to many elements and have special functions (such as controlling presentation or the language of the element), and I will teach you about these attributes in future tutorials, because they deserve the attention. But because I want these descriptions to be complete, I will mention the attributes without explaining them.
Let's have a look at the global structure elements first. Here's the
description of the HTML
element, the parent of all elements.
Name | HTML | |
Usage | The top-level element; all other elements must be contained within this element | |
Context | Cannot be contained within another element. | |
Contents | Must contain exactly
one HEAD and one BODY element.
| |
Start-tag | Optional | |
End-tag | Optional | |
Attributes: | ||
language attributes |
The HEAD
element, that contains the document head.
Name | HEAD | |
Usage | The document head, containing information about the document | |
Context | Must be
contained inside an HTML element.
| |
Contents | Must contain exactly
one TITLE element and may contain any number of other head elements.
| |
Start-tag | Optional | |
End-tag | Optional | |
Attributes: | ||
language attributes | ||
PROFILE | URI | Metadate profile dictionary |
And the BODY
element, that contains everything else.
Name | BODY | |
Usage | The document body. | |
Context | Must be
contained inside an HTML element.
| |
Contents | May contain any number of block elements. | |
Start-tag | Optional | |
End-tag | Optional | |
Attributes: | ||
element identifiers | ||
element title | ||
style directives | ||
event handlers | ||
language attributes | ||
color & background attributes |
Now let's go on and take a look at the head elements.
Produced by Stephanos Piperoglou
All Rights Reserved. Legal Notices.
URL: https://www.webreference.com/html/tutorial3/2.html
Created: June 25, 1998
Revised: June 25, 1998