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
3 Answers
+ 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
0
id can be used I only once. class can be used over and over again