What\'s the difference between
1) div id is not reusable and should only be applied to one element of HTML while div class can be added to multiple elements. 2) An id has greater importance if both are applied to the same element and have conflicting styles, the styles of the id will be applied. 3) Style element always refer a div class by putting a . (dot) in front of their names while div id class is referred by putting a # (hash) in front of their names. 4) Example :- class in id in
declaration -
.red-background { background-color: red; }
declaration -
#blue-background {background-color: blue;}
Here background will be in blue color