+ 1
Can anyone tell me the difference between id and class selectors in CSS with an example?
Tried making out the difference practically but both worked out the same for me.
3 Answers
0
A previous discussion on the same subject:
https://www.sololearn.com/Discuss/759805/?ref=app
+ 2
Tanish Kushwaha
you can access with id and class
but major difference between id and class is
class you can use to multiple HTML tags but id could only be used with one element (tag)
(id is always unique like your id card , your gmail id, Facebook id etc.)
+ 1
One more difference between id and class is when u put both in an element and there are conflicting with each other then id will be taken final decision.
How cool is it.