One element can have multiple classes
One of the benefits of using classes is that one element can belong to more than one class. To list classes, write them within the class attribute value separated by single spaces.
Let's say you have a page with a selection of products. You want all your prices to be displayed in blue and for discounted prices to be displayed in a light grayish cyan background. Set the class attribute value of a discounted price to "price best
", and add the following CSS rules:
.price {
color:blue;
}
.best {
background-color:#e1f6ee;
}