+ 1
what is the roll of class in HTML?
I just want to know the varaity of tasks they could perform.
4 ответов
+ 6
Yes you can define the class name on your own as long as it adheres to the naming rule. (e.g. no whitespace)
Here's the reference if you would like to find out more:-
https://www.w3.org/TR/CSS21/syndata.html#characters
+ 5
It relates each of the HTML element to a specific group which will be useful for styling similar items with CSS.
If you're familiar with social media, you can think of it like a hashtag. The ID of the post must be unique but different posts can share the same hashtag. 😉
We use dot prefix for class selector in CSS and document.getElementsByClassName method in JavaScript to retrieve the items.
+ 2
thank you so much.
+ 1
that's fine my friend but is that group is a selfmade process or an user define or both? I think both.