Span and div | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Span and div

What is the difference between span and div?

8th Apr 2022, 3:32 PM
Lilia  - avatar
2 Answers
+ 4
Span is an inline element whereas div is a block level element. Example- <span>1</span> <span>1</span> This will result in - 1 1 <div>1</div> <div>1</div> This will result in - 1 1
8th Apr 2022, 3:37 PM
Arnav Gumber
Arnav Gumber - avatar
+ 2
A div element is used for block-level organization and styling of page elements, whereas a span element is used for inline organization and styling. Hope that would help.
8th Apr 2022, 4:19 PM
Danish Zubair
Danish Zubair - avatar