What is the difference between DIV, SPAN and paragraph tag in HTML?

All three are used to hold content, but they are different.

TagTypeUse
<div>BlockGeneric container to group sections and for layout
<span>InlineGeneric container to style a small part of text
<p>BlockA paragraph of text, with a meaning
<div class="card">
  <p>My favourite colour is <span style="color:red">red</span>.</p>
</div>
Output in the browser

My favourite colour is red.

div and span have no meaning of their own, while p tells that the text is a paragraph. See HTML Div and Span.


Learn more about the similar topics:
Tutorials
List of common HTML Tags
HTML Elements and Tags
HTML Attributes
HTML Block and Inline Elements
HTML Div and Span
HTML Class and ID
Exercises & Assignments
No Content Found.
Interview Questions & Answers
Do all HTML tags require both a begin and end tag?
What is the difference between HTML tags and elements?
What is an attribute in HTML?
What is the difference between DIV, SPAN and paragraph tag in HTML?
What is the difference between inline and block elements in HTML?
What are void (empty) elements in HTML?
What is the difference between id and class in HTML?