What is the difference between HTML DIV and SPAN tag?

  • <div> is a block level tag which plays a big role in grouping various other HTML tags and applying CSS on group of elements.
  • <span> is an inline element and it can be used to group inline-elements in an HTML document. This tag also does not provide any visual change on the block but has meaning  when it is used with CSS.


<div style=”color:red”>
<h4>This is first group</h4>
<p>Following is a list of vegetables</p>
<div style=”color:green”>
<h4>This is second group</h4>
<p>Following is a list of fruits</p>

Leave a Reply