+ 2

What's the difference between "class" and "id"

Thanks for answer

23rd Jul 2017, 6:49 AM
Shanazar
Shanazar - avatar
3 Respuestas
+ 8
Multiple elements can have the same class but you cannot give multiple elements the same ID. So for example, use your classes for something like a button style and an id for a specific button to perform a specific action.
23rd Jul 2017, 6:52 AM
Jordan Chapman
Jordan Chapman - avatar
+ 1
😮 Thanks a lot. I didn't know about it
23rd Jul 2017, 7:04 AM
Shanazar
Shanazar - avatar
0
In CSS, classes are declared with "." and id's are declared with "#"
23rd Jul 2017, 8:24 PM
BwD//Felix Janetzki
BwD//Felix Janetzki - avatar