0

Use of class in css

31st Mar 2020, 1:30 AM
Manav Deep
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.
31st Mar 2020, 1:51 AM
Avinash Khatri KC
Avinash Khatri KC - avatar
- 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!!! 😃
31st Mar 2020, 1:54 AM
Abhay
Abhay - avatar