+ 4

What's the difference between id and class?

Seriously i don't see a difference for some situation(s).

14th Oct 2017, 6:38 PM
Wensley
Wensley - avatar
4 Answers
15th Oct 2017, 1:01 AM
Zephyr Koo
Zephyr Koo - avatar
+ 3
id must be used by one object tag. class defines style for several objects tags. if you declare several p tag with the same style, use class option. otherwise, you must create an id option by p tag
14th Oct 2017, 7:34 PM
MBZH31
MBZH31 - avatar
+ 3
Explaining this ideology to the lowest term, the names "class" and "id" given in HTML in real life means... Class can be defined as a group of elements just like having different students in a class room. Id can be defined as an identity given to every element in the class - "Every students having their own identity in a class room. Your teacher identifies you by your ID information".
15th Oct 2017, 4:45 AM
Franky BrainBox
Franky BrainBox - avatar
+ 2
class is common, id is unique. you can't use unique id on the page twice, but you can use a class as many times as you want to.
4th Nov 2017, 9:16 AM
Olga Gospadaryova
Olga Gospadaryova - avatar