Now that you know how to label HTML elements with a class, we can style elements belonging to the same class at once. How exactly do you select them in CSS, though?
To style elements of the same class, you can use a class selector in the stylesheet.
font-family: Georgia, Times, serif;
Class selectors begin with a period (
.) and are immediately followed by the name of the class. In the example above, all elements with a class of
science will have their typeface, color, and letter case modified.