In this article today we are talking difference between “Div” and “Span”
<div> Div is block element are take the full available width of block level. Div tags are used to define section in document block wise element.
Note: Block level elements are <div>, <p>, <img>, <section> and many more.
Example of block level element see below:
<div> full available width of block level </div>
<span> Span Inline elements are only take the width that is required to fit into the box.
span is very similar to the HTML “div” tag, but div is a block-level tag and span is an inline tag. Span element is a generic online container for online elements and content.
Span Inline elements are only take the width that is required to fit into the box.
Example of inline element see below:
<span> required to fit width into the box. </span>