HTML and CSS Reference
with other selectors, separated by commas, as in the third example. The
only restriction on classes is that they cannot be nested; for example,
p.equation.centered is not valid.
Accordingly, the first rule in the example creates a class of paragraph
styles named abstract whose text is italic and indented from the left and
right margins by 0.5 centimeters. Similarly, the second paragraph style
class, equation , instructs the browser to center the text and to use the
Symbol typeface to display the text. The last style rule creates a style
with centered text and 0.5-centimeter margins, applying this style to all
level-1 headers as well as creating a class of the <p> tag named centered
with that style.
To use a particular class of a tag, you add the class attribute to the tag,
as in this example ( Figure 8-4 ):
This is the abstract paragraph. See how the margins are indented?
<h3>The equation paragraph follows</h3>
a = b + 1
This paragraph's text should be centered.