HTML info
A uniform resource identifier or URI is a way to refer to certain things, such as the HTML document that is the source of this page; the URI for this page might then be
http://www.math.metu.edu.tr/~dpierce/html_info.html.
More information is at Berners-Lee et al., Uniform Resource Identifiers (URI): Generic Syntax.
To see the source of a document such as the present one, in Netscape, click on View, then Page Source; alternatively, before the URI in the Go to: window, type view-source:. (On complicated pages these methods can have different results.)
The following notes are based on the HTML 4.01 Specification of the World Wide Web Consortium.
An element is a certain sort of section of an HTML document. Elements can be nested. An element has up to three parts:
- start tag,
- content,
- end tag.
An element may have an attribute, which may have a value. An attribute name appears in the start tag after the element type. If the attribute has a value, then the attribute name is followed by an equals-sign, and then by the value in quotes. Further attribute name/value pairs may be listed, separated by spaces; the order of these pairs does not matter (check this). The attribute name is case-insensitive; the value is usually so. To delimit values, double-quotes or single-quotes can be used, the one kind if the other kind appears in the value. A quotation-mark can be given in various ways:
- double-quote:
- "
- " (a numeric character reference)
- " (a character entity reference)
- single-quote:
- '
- '
An HTML document may contain comments. A comment is introduced by the markup declaration open delimiter, or <!, followed immediately (with no whitespace) by the comment open delimiter, or --. The comment close delimiter is the same as the open; it is followed by the markup declaration close delimiter, or >, possibly with intervening whitespace. (Reference)
An HTML document is begun with a document type declaration, such as
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">.
The rest of the document constitutes an HTML element. For this, tags are optional. The HTML element has two constituent elements, tags optional for each:
- HEAD, and
- BODY.
One may want to provide meta data for an HTML document; this is done through the HEAD element and through META and LINK elements in it.
Providing a meta datum means declaring a property and a value for it. The means for interpreting such data may be found in a meta data profile; this profile will reside at some URI.
The HEAD element therefore has a profile attribute, whose value is the URI of the desired meta data profile.
The HEAD element may contain a META element, which is coextensive with its start tag (the element has no content and no end tag). The attributes specific to the META element are:
- name,
- content,
- scheme,
- http-equiv.
A META element thus determines a property/value pair. If the value is to be a URI, then the LINK element can be used instead to give the pair.
Like the META element, the LINK element has no content or end tag. Some of its specific attributes are these:
- href
- type
- rel
- rev
Link types are case-insensitive. Standard ones are the following (others can be defined in a meta data profile):
Alternate; stylesheet; start; next; previous; contents; index; glossary; copyright; chapter; section; subsection; appendix; help; bookmark.
If one of these is the value of the rel attribute, then it describes the relation of the document (for example) at the URI (that is the value of the href attribute) to the present document. If one of the link types is the value of the rev attribute, then it describes the relation of the present document to the other document.