0

Understanding html

What is the difference between div and span

23rd May 2025, 9:34 AM
Miriam Mutize
Miriam Mutize - avatar
2 Answers
23rd May 2025, 9:58 AM
Gulshan Mahawar
Gulshan Mahawar - avatar
+ 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
23rd May 2025, 9:58 AM
Snehil Pandey
Snehil Pandey - avatar