вторник, 30 марта 2010 г.

What the 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>

Комментариев нет: