+ 3
how class and id are different? when should we use them?
2 Respostas
+ 4
The id is a good choice to identify a HTML element. Class is good to style a consistent group of elements via external CSS file. (Please upvote if you like the answer)
+ 1
Class is mostly used when u want to use it again on other elements inside the code/page for style for example.
While id, you can only use once