+ 2

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

Thanks for answer

23rd Jul 2017, 6:49 AM
Shanazar
Shanazar - avatar
3 Answers
+ 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
ļ¼¢ļ½—ļ¼¤ļ¼ļ¼ļ¼¦ļ½…ļ½Œļ½‰ļ½˜ ļ¼Ŗļ½ļ½Žļ½…ļ½”ļ½šļ½‹ļ½‰
ļ¼¢ļ½—ļ¼¤ļ¼ļ¼ļ¼¦ļ½…ļ½Œļ½‰ļ½˜ ļ¼Ŗļ½ļ½Žļ½…ļ½”ļ½šļ½‹ļ½‰ - avatar