Working with IDs and classes

Classes and IDs, as well as HTML elements, are implemented as selectors in external or embedded style sheets. In the terminology for style sheets, a selector is an element to which a style definition is assigned. Selector elements are not enclosed in angle brackets (< >).

If you define classes and IDs in external style sheets, they are available to all of the files that share that style sheet. You can define style characteristics for an ID or class, then assign that ID or class as an attribute to an HTML element.