+ 1

[DUPLICATE] what is difference between #id and . class

21st Jan 2018, 9:27 AM
imran ahmed
2 Answers
+ 15
Unlike the id selector, the class selector is most often used on several elements. This allows you to set a particular style for many HTML elements with the same class. The class selector uses the HTML class attribute, and is defined with a "." id is used when we have to apply CSS property to one attribute only ID's are unique Each element can have only one ID Each page can have only one element with that ID Classes are NOT unique You can use the same class on multiple elements. You can use multiple classes on the same element.
21st Jan 2018, 9:27 AM
Scooby
Scooby - avatar