What is the difference between DIV, SPAN & Paragraph tag in HTML?

What is the difference between DIV, SPAN & Paragraph tag in HTML?

<div> tag is the most common element to define a division and section. This is a block element which means it adds a line break before and after the content inside. Mostly, <div> tag is used to create content boxes and layouts in a website.

<span> an inline element, it only takes the required space in the same line and does not add line breaks. This is helpful for when we need to apply some styles to inline elements such as image, links or highlight piece of text.

<p> tag is used to defines paragraphs. The content written in paragraph adds some space before and after each element just like any document paragraphs.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.