0
Understanding html
What is the difference between div and span
2 Answers
+ 3
Miriam Mutize
Refer to the below thread:
https://www.sololearn.com/Discuss/3014387/?ref=app
+ 3
It would be great if you do it practically
Use both tags write something inside and see the visuals
But make sure to use it inside a <p> tag
What we notice:
The content inside div is displayed in a separate bock between the text
While the span doesn't.
Why so?
Because div is block-line element
While span is inline element
==
One more thing using div inside p is not correct hierarchy but for understanding we can do anything
https://sololearn.com/compiler-playground/WgqboJ3I6Sso/?ref=app