Headings, paragraphs, lists, pre-formatted text and tables are not the only sections as Web page can have. You can also create other logical divisions in your HTML document by using SPAN and DIV tags.
First, what is DIV?
Div is the tag defining the style of any block element. And what is block element? It is an HTML element that is automatically preceded and followed by a line feed in the client browser (for example, <p> or <h1>); opposite of an in-line element. Div is also use to create a block or layer.
Second, what is SPAN?
Span is the tag defining the style of any in-line element. And what is in-line element? It is an HTML element does not cause the addition of preceding and following line feeds in the client browser (for example, <strong> or <i>); opposite of a block element. Span is use to group inline elements.
If span is for in-line elements, then div is for block elements.
What's the difference?
In-line elements do not create line breaks while block elements do.
I learned that using span tag can style the font and color of any part of my paragraph any way I want. For example:
<p><span style="color: maroon; font-size: 2em;">I</span>n-line skating is my favorite event in the Asian X-games.</p>
And in Div.....
<div class="box"> I'm pretty. Your opinion is not needed.<br />
Okay?</div>
THANKS FOR READING MY BLOG! SMILE BEFORE YOU LEAVE! ジ