HTML elements with attributes
3.4
Lesson

Class Attribute

Sometimes, we want to group a few of our elements together so that when we want to change them through CSS or JavaScript, we can access all of them at one time.

For this, we use the class attribute.

In the example above, we have grouped all the p elements by giving their class attributes the value learning-resources. Similarly, we have grouped all the links by giving their class attributes the value resource-links.