HTML class Attribute
Example
Using the class attribute in an HTML document:
Heading 1
A paragraph.
Note: This is a very important paragraph. :)
Try it »
More examples follow later in this chapter.
Browser support





All major browsers support the class attribute
Definition and Usage
The class attribute defines a class name for an element.
The class attribute is often used to point to a class in a style sheet. However, it can also be used in JavaScript (through the HTML DOM) to change the class name of an HTML element.
Differences between HTML 4.01 and HTML5
In HTML5, the class attribute can be used on any HTML element (it will validate any HTML element, but it may not be useful).
In HTML 4.01, the class attribute cannot be used on:
HTML Global Attributes