0
Use of class in css
2 Answers
0
In the CSS, a class selector is a name preceded by a full stop (â.â) and an ID selector is a name preceded by a hash character (â#â). The difference between an ID and a class is that an ID can be used to identify one element, whereas a class can be used to identify more than one.
- 1
The class in css is used to point out a Html tag that you want to edit.
I will explain u with a example :-
Suppose u dont use class and used a tag name then all the similar tag of that name got changed like :-
p{
transition : 1s linear;
}
p:hover{
TRANSFORM: scale(1.5);
}
But if u uses a class on a html tag and extends the starting p with that class name then only that html tag will got edited
p.nam{
transition : 1s linear;
}
p.nam:hover{
TRANSFORM: scale(1.5);
}
And sorry for my bad English!!!
đ



