--- title: CSS Classes --- ## CSS Classes Classes are an efficient way of grouping HTML elements so that they can share the same styles. CSS (Cascading Style Sheets) classes can be used to arrange and decorate web page elements. When writing HTML, you can add classes to an element. Just add the attribute `class="myclass"` to the element. Multiple elements can have the same class, and one element can have multiple classes. You can assign multiple classes to an element by adding all the desired class names separated by a space to the `class` attribute in HTML. ```html
is a popular catchphrase that Super Man often said.
``` You can then style these elements with CSS. Classes are referenced with a period (.) before them in CSS, but you should not put periods in your HTML. ```css .super-man { color: red; background-color: blue; } ``` This code will give a blue background and red text color to all the elements which have the `super-man` class. [View this example on CodePen](https://codepen.io/Tlandis/pen/RLvomV). You can also declare more than one class to your element, like: ```html