An HTML document is made up of a a series of HTML elements, whose structure describe the logical format of a document. Some elements, such as the document head and document body elements, must be present in every HTML document. Others, such as the table, paragraph, and section heading elements, are used to provide the document's content, while others still, such as the strong, and underline elements, are used to modify the presentation of text within the document.
HTML elements can be separated into two categories, those which can contain other elements, and those which stand alone. Container elements are those elements which either provide a logical entity which itself has content, such as a paragraph or a table, or which modify the presentation of their contents.
Container elements are marked by both a start tag, consisting of the element's name between angle brackets
(< >
), and an end tag, consisting of a slash (/
) character, followed by the element name, also within
angle brackets. For example, to indicate that text should be emphasized, it is placed within the EM
(emphasis) element:
<EM> This text would be emphasized </EM>
Standalone elements, on the other hand, are used to create a single object, such as an image or a line break. Standalone elements have no content,
and thus do not require an end tag. For example, to create a horizontal line, the HR
(horizontal rule) element is used:
<HR>
In addition, many elements accept, or even require, further information in order to function. Such information is passed to an element by
including an attribute within the element's start tag. An attribute is a keyword, and possibly an equals sign (=
) and a value.
For example, the HR
element can be told to draw a more two-dimensional line by passing it the NOSHADE
attribute:
<HR NOSHADE>
and can be given an alignment by specifying the ALIGN
attribute, with a value of left
, right
, or
center
:
<HR ALIGN="right">
Note that the value passed to an attribute should be enclosed in double quotes. Although this is not required for all values, it is always a good idea, as different browsers have different requirements for which types of attribute values require quotes. Note also that the names of elements and of attributes are not case sensitive. Many HTML authors indicate the names of elements entirely in capitals so as to better distinguish them from the surrounding text, however. Note that some older browsers do not deal well with element names in mixed-case, so you should stick to either all capital or all lower case letters.
Every page you design must consist of at least the following elements:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Your Title Here</TITLE> </HEAD> <BODY> </BODY> </HTML>
This simple template provides all of the sections and elements required by the HTML 3.2 standard. Although it is technically valid to
exclude some of the tags marking these elements, it is poor style to do so, and may confuse some browsers. The entire content of your page
should be placed between the <BODY>
and </BODY>
tags (i.e. within the <BODY>
element).
Thus, the elements which must be present in any HTML document are:
!DOCTYPE
EN
can be replaced with
the two-digit abbreviation of the documents language from ISO 630.
HTML
HEAD
HEAD
element can contain such information as the name and address of the author, or the last time the
file was modified.
TITLE
TITLE
element may not contain other elements.
BODY
The HTML 3.2 standard defines 70 elements which can be used in the design of a valid HTML document. The valid standard elements can be separated into several basic categories:
HEAD
and BODY
elements, and the obsolete PLAINTEXT
element. These are the elements which can appear
directly within the HTML
element.
APPLET
element, these attributes are used to provide information to a Java applet.
FORM
element, these elements are used to provide data fields, such as radio buttons and popup menus.
MAP
element, these elements are used to provide client-side image maps.
TABLE
element, these elements are used to provide structured, formatted tables.
This page was last modified on May 9, 1999