have opening and closing tags are referred to as container elements,
do not have closing tags.
Closing tags are not required for empty elements and sometimes not allowed.
INCORRECT <tag1>...<tag2>.....</tag1>...</tag2>
Elements can have attributes, which provide additional information about the enclosed text. These attributes can be added to the opening tags. They cannot be repeated within an element. They are never added to closing tags.
An attribute consists of a name and (most of the times) a value. The value may be enclosed in quotes ("), and must be enclosed in quotes if the value contains more than just letters, digits, hyphens and/or periods.
An example of an attribute is the background
attribute on the body element for this page:
<body background="/cgi400c2/htmlback.gif">
The attribute is background and the value is /cgi400c2/htmlback.gif which is enclosed in quotes. This attribute defines the image to be used in the background. Because the value consists only of letters, the quotes are optional.
| Home | HTML basics- Part 1 - Agenda | Next |
T07D010