you’re on your way 4
13
next generation applications
A <div> is a container element that can hold
related elements, and allow you to style all those
elements with one CSS rule.
<div>
<div id=”menu”>
<a href=”home.html”>home</a>
<a href=”books.html”>writing</a>
<a href=”links.html”>resources</a>
<a href=”lib.html”>library</a>
</div>
Use a <div> to group together
elements with a similar purpose.
You can refer to a <div>’s
id in your CSS to style
everything within the
<div> at one time.
<span> lets you separate a bit of inline text from
its surroundings. You can style your <span>
elements using CSS, and set off text easily.
<span>
<ul>
<li><span class=”cd”>Buddha Bar</span>,
<span class=”artist”>Claude Challe</span></li>
<li><span class=”cd”>When It Falls</span>,
<span class=”artist”>Zero 7</span></li>
...
<span> elements can
set off text, but
don’t start new
paragraphs or blocks.
HTML Refresher
Feeling a little rusty on your <div>s and <span>s? We’re going to dive into
some HTML on the next page, so before we do, here’s a quick refresher
course on two of the coolest HTML elements you’ll ever run across.
<span> elements don’t
create a new block of
text, but can still by
styled with CSS.