Element Identifiers (class and id)

The previous examples show how the id and class attributes are used to turn generic div and span elements into elements with specific meanings and uses. It should be pointed out that class and id attributes may be used with nearly all (X)HTML elements, not just div and span. This section discusses the id and class element identifiers and their distinct uses.

Get Web Design in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.