Difference between div and span tag
The basic difference between them is ,div is
block level element and span is inline level element.
<span>
and <div> tags both allow a Web designer to style text and add
other formatting attributes to their Web page. They are not
interchangeable tags, though. <div> tags are block-level elements,
whereas <span> tags are not.
Div
<div> tags are block elements that allow you to
position elements contained within them
Example
<div style="color:#00FF00">
<h3>Welcome to
Studentacad.com</h3>
<p>This is a paragraph.</p>
</div>
Span
<span> tags are NOT block elements
<p>This
Blog is manage By<span class="blue">Aamir Hasan</span>
(CEO)</p>
Revision number 1, Sunday, March 21, 2010 6:53:23 PM by Aamir Hasan
This is not the most up to date version of this article. The most recent version can be found here.
You must Login to comment.
|
Tue, Mar 23, 2010 3:00 AM
by ngobw
|
Another difference I see would be that you can use span> in a div> but not vice versa, strictly speaking.
|
|
Wed, Mar 24, 2010 11:02 AM
by cnranasinghe
|
Better explain when to use Div and when use span!
|