Exploring Class and Grouping

Two other interesting aspects of style sheets include class and grouping. Class refers to ways of breaking down your style rules into very precise pieces. Whenever you want some of the text on your pages to look different from the other text, you can create what amounts to a custom-built HTML tag. Each type of specially formatted text you define is called a style class.

For example, suppose you want two different kinds of H1 headings in your documents. You can create a style class for each one by putting the following text in the style sheet: