0

what is the difference between id and class?

I know the basic use from examples but I still don't fully understand the difference

10th Aug 2016, 4:43 PM
Hoeft Brian
Hoeft Brian - avatar
2 odpowiedzi
+ 4
when u want to style a class element it is styled with a element.class_name whereas when styling an element with some id it is styled with a #id_of_element and id is unique for an element i.e. there can not be two or more elements with same id_name whereas we can use same class name for different elements and classes are usually created for a section of the web page
11th Aug 2016, 9:47 AM
zaheer
zaheer - avatar
0
id can be used I only once. class can be used over and over again
13th Sep 2016, 7:22 AM
Arnold Gyan
Arnold Gyan - avatar