Simple discussion: Span vs. Div Tags

A tiny question but many times it has been asked in various discussion forms and interviews about the difference between Span and Div tags.

Div stands for Division which means to divide a place or body or page where need to show some tasks. So, Div tag is nothing but its Divide a page or in another words its a block element which blocks the entire page withing tags

Span is an inline element.So, its print in the same line.

Check following example:

<title>Div vs Span</title></head>
<P><b>Difference : Div and Span</b></p></span></em>

<b>Span Example</b><br/>
<span>This line is within the span tag and will output in same line.</span>
<b>Div Example</b></p>

<div>This line is within the div tag.
<p>We can use paragraphs within division but not divisions within paragraphs.</p>

Leave A Reply