What is the differnce between class,id, span,div element of html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the differnce between class,id, span,div element of html?

html

28th Mar 2020, 5:42 PM
Vivek Kumar
Vivek Kumar - avatar
2 Answers
29th Mar 2020, 8:47 PM
Vivek Kumar
Vivek Kumar - avatar
+ 1
class and id are attributes. span and div are tags. multiple tags can have same class but id should be unique to each element. div is a block level tag and span is inline tag. however both of these are non-semantic tags i.e they don't have special meaning and whenever possible they should be replaced by semantic tags.
28th Mar 2020, 6:12 PM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar