+ 1
What is the different Between Class and Id in CSS?
?
4 Answers
+ 6
Class can be used multiple times but id is supposed to be used only once
+ 4
One element can be specified by many class but 1 element can't get many ids
+ 1
use the searchbar. it was asked a lot here
but here's your salad-:
Id is unique, so every element has different id.
Many elements can have same class name since classes aren't unique, and that helps manipulating collectively just using a single class name, than styling each one of them with different id.
0
With ID we can have only one element with that ID
on the other hand there can be as my elements with same classes in a html document