The Structure of HTML documents
|
An HTML document consists of text and tags that mark the structure
of the document.
Elements in an HTML document are delimited by
the tags which include < and >.
Some elements have both a start and
end tag: e.g., <TITLE> and </TITLE>.
Other elements use only a single tag: e.g., <P>
(the paragraph element).
Some elements have attributes, which are qualifications
of the element's meaning or optional parameters for that element.
|
Every HTML document must at least include the descriptive title element, e.g:
<TITLE>The WDVL: The Structure of an HTML Document</TITLE>
More generally,
documents can start with a <!DOCTYPE> declaration followed
by an HTML element containing a
HEAD and then a
BODY element.
An HTML 4.0 document comprises three parts:
- a line containing
HTML version information,
-
HTML:
- a declarative header section
(delimited by the
HEAD element),
- a body, which contains the document's actual content.
The body may be implemented by the
BODY
element or the
FRAMESET element.
White space (spaces, newlines, tabs, and comments) may appear
before or after each section.
Sections 2 and 3 should be contained within the
HTML element.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<Head>
<TITLE>The WDVL: HTML 3.2</TITLE>
.. other head elements ..
</Head>
<Body Background = "/Images/margin.gif"
Bgcolor = "#ffffff"
Text = "#000000"
Link = "blue"
Vlink = "purple"
Alink = "red" >
.. other BODY elements ..
</Body>
</HTML>
The BODY attributes are deprecated in HTML 4.0.
BODY comprises:-
Block Elements
Headings, Paragraphs, Unordered, Ordered, and Definition Lists
Forms
User-input Forms: Text Fields, Buttons, Menus, and more
Frames
Multi-view presentation of documents
Links
Hypertext and Media-Independent Links
Tables
arrange data -- text, preformatted text, images,
links, forms, form fields, other tables, etc. --
into rows and columns of cells.
Text
Paragraphs, Lines, and Phrases
|