Results 1 to 6 of 6
Oct 10, 2002, 10:27 #1
- Join Date
- Sep 2002
- Arlington, VA
- 0 Post(s)
- 0 Thread(s)
When to use DIV or SPAN and CLASS or ID
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?
<div class="header"> <span class="spacer"> </span> <span class="title">Title</span> <span class="subtitle">Sub title</span> <div class="spacer"> </div> </div>