Hi everyone.

I've been using CSS for a while, but just recently I was thinking more about it and I realized I don't know something that maybe central to CSS.

When to use DIV instead of SPAN and when to use CLASS instead of ID.

Any ideas? I know DIV throws the extra return in there, and ID is useful when using the DOM, but is there any other real distinction?

Like for this code below, I'm trying to design the site without tables since it is an intranet site and I realized, should those SPANs be DIVs or vice versa? What about those classes, should they be IDs. Any ideas?

Code:
<div class="header">
<span class="spacer">&nbsp;</span>
<span class="title">Title</span>
<span class="subtitle">Sub title</span>
<div class="spacer">&nbsp;</div>
</div>