HTML provides two global attributes, the ID and CLASS attributes, which may be used to identify an instance of an element. Almost every HTML element may be assigned identifier and class information.
The id attribute assigns a name to an element, which must be unique in a document. The ID attribute may be used:
- as a target anchor for hypertext links
- as a means to reference an OBJECT element in a script
- as a style sheet selector
The class attribute, on the other hand, assigns one or more class names to an element; the element may be said to belong to these classes.
A class name may be shared by several elements.
The CLASS attribute is generally used as a style sheet selector, when an author wishes to assign style information to a class, or a set, of elements.
Presented here is just a brief overview of HTML, which hopefully has provided enough information to get you started. Specific information on the use of HTML elements may be found in the appropriate sections.
For the complete list of elements and attributes in HTML, see the HTML Reference Table.
Some relevant external references:
Previous: Web Authoring Basics Next: Using Style Sheets