From: CSS3 The Missing Manual 3rd Edition by David Sawyer McFarland
<div> and <span> explained
http://youtu.be/gih3utjXO4M
And
http://youtu.be/qFk2Tqhaa6M
Understanding the <div> and <span > tags
The <div> tag and the <span> tag are like empty vessels that you fill with content. A
div is a block, meaning it has a line break before it and after it, while a span appears
inline, as part of a paragraph. Otherwise, divs and spans have no inherent visual
properties, so you can use CSS to make them look any way you want. The <div>
(for division) tag indicates any discrete block of content, much like a paragraph or
a headline. But more often it’s used to group any number of other elements, so
you can insert a headline, a bunch of paragraphs, and a bulleted list inside a single
<div> block. The <div> tag is a great way to subdivide a page into logical areas,
like a banner, footer, sidebar, and so on. Using CSS, you can later position each area
to create sophisticated page layouts (a topic that’s covered in Part III of this book).
The <span> tag is used for inline elements; that is, words or phrases that appear
inside of a larger paragraph or heading. Treat it just like other inline HTML tags
such as the <a> tag (for adding a link to some text in a paragraph) or the <strong>
tag (for emphasizing a word in a paragraph). For example, you could use a <span>
tag to indicate the name of a company, and then use CSS to highlight the name by
using a different font, color, and so on. Here’s an example of those tags in action,
complete with a sneak peek of a couple of attributes—id and class—frequently used
to attach styles to parts of a page.
<div id="footer">
<p>Copyright year xxxx, <span class="bizName"> mydomain.com</span></p>
<p>Call customer service at xxx-xxx-xxxx for more information</p>
</div
Additional tags in HTML5
The <div> tag is rather generic—it’s simply a block-level element used to divide a
page into sections. One of the goals of HTML5 is to provide other, more semantic
tags for web designers to choose from. Making your HTML more semantic simply
means using tags that accurately describe the content they contain. As mentioned
earlier in this section, you should use the <h1> (heading 1) tag when placing text that
describes the primary content of a page. Likewise, the <code> tag tells you clearly
what kind of information is placed inside—programming code.
HTML5 includes many different tags whose names reflect the type of content they
contain, and can be used in place of the <div> tag. The <article> tag, for example,
is used to mark off a section of a page that contains a complete, independent composition…
in other words, an “article” as in a blog post, an online magazine article,
or simply the main text of the page. Likewise, the <header> tag indicates a header
or banner, the top part of a page usually containing a logo, site-wide navigation,
page title and tagline, and so on.
Many of the new HTML5 tags are intended to expand upon the generic <div> tag,
Here are a few other HTML5 tags frequently used to structure the content on a page:
• The <section> tag contains a grouping of related content, such as the chapter
of a book. For example, you could divide the content of a home page into three
sections: one for an introduction to the site, one for contact information, and
another for latest news.
• The <aside> tag holds content that is related to content around it. A sidebar in
a print magazine, for example.
• The <footer> tag contains information you’d usually place in the footer of a
page, such as a copyright notice, legal information, some site navigation links,
and so on. You’re not limited, however, to just a single <footer> per page; you
can put a footer inside an <article>, for example, to hold information related
to that article, like footnotes, references, or citations.
• The <nav> element is used to contain primary navigation links.
• The <figure> tag is used for an illustrative figure. You can place an <img> tag
inside it, as well as another new HTML5 tag—the <figcaption> tag, which is
used to display a caption explaining the photo or illustration within the <figure>.
Guys at coffeecup are awesometacular.