Confused


#1

It's not about code errors, but I am just curious.
In the information, it says that we use classes for many elements that we want them to get the same effect. Also, it says that we use IDs for one element.
So, my question is, why do we use classes for many, and IDs for one? What is the difference? Why can't we use classes for one and IDs for many? I'm so confused! Please help me!!!!!


#2

I could write a new answer, but someone answers this question brilliantly here.

Browser today support the same id name for different elements, this is too bad since it is bad practice


#3

It is just how convention is, you technically could use id's for many and a class for one, but it is mainly for organization.


#4

Yes, now you can because browser support it. Long ago, you couldn't. Browser did not support it. Doesn't take away the fact that it is bad practice, if you understand the point system of css, you would understand better why this is bad practice


#5

Thanks!! Now I'm not confused at all!!!!!!:smile::smiley:


#6

If you are interested i can give you a good article about the point system, it is a bit tricky, but i found it very useful