your post, Gently down [thelist] ... Friday Fun

Tom Dell'Aringa pixelmech at yahoo.com
Fri Aug 1 13:57:06 CDT 2003


--- rudy937 at rogers.com wrote:
> > p.foo span { color: #c36; }
> no, for DIVs it would be div.foo, not p.foo   ;o)

yeah yeah yeah, its friday

> of course spans would never be nested in DIVs, but only in Ps,
> right?
> 
> so you'd probably want to say
> 
>    div.foo p span { }
> 
> but in any case, if you have more than one DIV with a class of foo,
> isn't that already a form of classitis?  or a symptom of some other
> problem?
> 
> a document can have many DIVs, of course, but if you think of the
> typical structure, there's what, a header, a sidebar, maybe a
> second sidebar, a main content area, a footer...  but where do you
> get many DIVs that might all have to be treated the same so that
> they'd all have to have the same class?

Lemme 'splain. Good idea, bad example. Here's a real world example. I
had a need for a header on my pages that essentially was this:

Header: Value

Where the header was bold and one color, and the value was plain and
black. I also wanted it to act like a header in that it had some
margins.

Instead of using the strong/bold tag in a p (which would have no
semantic value anyway as a header) I used an H2 and a span.

h2 span { font-weight: normal; color: #000; }

And the rest acts like an h2 header. It has the semantic meaning of a
header (which it is).

And the simple markup is:

<h2>Header: <span>value</span></h2>

Hope that makes more sense.

Tom

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: Premium Content Author / JavaScript / Every Friday!
http://www.maccaws.com/ :: Group Leader
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward


More information about the thelist mailing list