Class selector syntax
To define any class in the <style>
tag, type its value preceded by a period (.). For example, to set the blue color for all elements of the class price
, we should apply the following rule:
.price {
color:blue;
}
This rule will only affect elements with the attribute class=" price"
, while other elements will remain unchanged.