+ 3

how class and id are different? when should we use them?

22nd Apr 2017, 5:29 PM
Krishna Teja
Krishna Teja - avatar
2 Réponses
+ 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)
22nd Apr 2017, 5:57 PM
⏩▶Clau◀⏪
⏩▶Clau◀⏪ - avatar
+ 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
22nd Apr 2017, 9:31 PM
Celso Matule
Celso Matule - avatar