Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The W3C has pulled in the reins with the HTML 4.0 specification
(which is further refined in the current 4.01 version). It incorporates
many of the tags introduced by the popular browsers that improve
web functionality. It also officially "deprecates" tags that are used in
common practice but are not in keeping with the priorities of the
markup language (such as keeping style information out of content).
Before HTML there was SGML (Standard Generalized Markup Language),
which established the system of describing documents in terms of their
structure, independent of appearance. SGML is a vast set of rules for
developing markup languages such as HTML, but it is so all-encompassing
that HTML uses only a small subset of its capabilities.
Cascading Style Sheets promise to keep style information out of the content
by storing all style instructions in a separate document (or a separate section
of the source document).
The HTML 4.01 Strict DTD excludes all deprecated tags and attributes (those
scheduled to be phased out). In an ideal world, all developers would mark up
the structure of their documents according to the strict version of HTML,
leaving all presentation to be handled by style sheets.
The HTML 4.01 Transitional DTD is less restrictive, and it includes many of
the elements dedicated to appearance (such as the <font> tag and
the align attribute) that are in common use today. Most developers today
comply with the transitional specification because it allows more control over
presentation while the industry waits for older browsers (those that don't
support new features such as style sheets) to fade away.
The Frameset DTD is identical to the Transitional DTD, except that it allows
for the <frameset> element to be used in place of the
standard <body> element.
HTML Tags
Elements in the HTML specification are indicated by tags. An HTML tag is
made up of the element name followed by an optional list of attributes, all of
which appears between angle brackets (< >). Nothing within the brackets is
displayed in the browser. The tag name is generally an abbreviation of the
element's name or the tag's function (this makes them fairly simple to learn).
Attributes are properties that extend or refine the tag's function.
In the current specification, the name and attributes within a tag are
not case sensitive. <BODY BGCOLOR=white> works the same
as <body bgcolor=white>. However, values for particular attributes may be
case sensitive, particularly URLs and filenames.
Containers
Most HTML elements or components are containers, meaning they have
a start tag and an end tag. The text enclosed within the tags follows the
tag's instructions. In the following example, the <I> container tags make the
enclosed text italic:
The end tag contains the same name as the start tag, but it is preceded by
a slash ( / ). You can think of it as an "off " switch for the tag.
For some tags, the end tag is optional and the browser determines when the
tag ends by context. This practice is most common with the <p> (paragraph)
tag. Most browsers automatically end a paragraph when they encounter a
new start tag (although Navigator 4.x has some problems with autoclosing),
so many web authors take advantage of the shortcut. Not all tags allow this,
however, and not all browsers are forgiving, so when in doubt include the
end tag. This is especially important when using Cascading Style Sheets with
your document. The new XHTML standard also requires that all tags be
closed.
Attributes
Attributes are added within a tag to extend or modify the tag's actions.
Attributes always go in the start tag only (end tags never contain attributes).
You can add multiple attributes within a single tag. Tag attributes, if any, go
after the tag name, each separated by one or more spaces. Their order of
appearance is not important.
Most attributes take values, which follow an equals sign (=) after the
attribute's name. Most browsers cannot handle attribute values more than
1,024 characters in length. Values may be case-sensitive, particularly
filenames or URLs.
Nested tags do not necessarily need to appear right next to each other. In
this example, the bold text is nested within a longer link.
Extra spaces can be added within the flow of text by using the nonbreaking
spacecharacter entity ( ). Multiple spaces are displayed, however,
when text is tagged as preformatted text (<pre>).
Unrecognized tags
A browser simply ignores any tag it doesn't understand or that was
incorrectly specified. Depending on the tag and the browser, this can have
varied results. The browser displays nothing at all, or it may display the
contents of the tag as though it were normal text.
Text in comments
Browsers do not display text between the special <!-- and - -> elements
used to denote a comment. Here is a sample comment:
<!-- This is a