I was at w3schools.com learning html and their code examples included the word “class” such as <div class="page"> . They didn’t explain it so i needed you guys to. So please define what class in <div class="page"> means.
I was at w3schools.com learning html and their code examples included the word class
Share
A class is a non-unique identifier for HTML elements. It can be used in a variety of ways:
1. For styling of those elements with CSS.
To apply a group of CSS properties as a pack to all elements of the class.
You can apply it like this:
Ans so on.
You can also restrict it to only be valid for a specific element type, for example, only for divs:
2. For accessing these elements with JavaScript.
To perform some manipulations with all elements of the class. Like this:
3. For some internal operations in browser. Beyond the scope of this question.