[thelist] stupid CSS question
Matt
mspiegler at lightbulbpress.com
Wed Nov 28 08:13:29 CST 2001
Thanks for all the responses. Looks like in the final analysis, it can be
done, but only 5% of the audience is guaranteed to see it :) (Isn't that
NN6's market share at this point?)
The reason I actually wanted to do it was so that I could create a
customizable site in which all colors could be changed quickly and easily.
The idea was that there would be 6 color classes, say "color1" through
"color6", and all elements w/in the site would be assigned one of the color
classes, plus a custom style class, e.g.:
<td class=" color1, foo">fee fi foo fum!"</td>
That way I could simply change the 6 color classes at the top of the
stylesheet and presto the whole site goes from blues to reds.
a boy can dream....
Matt
rudy wrote:
> > but can I do:
> >
> > .foo{color:#FFFFFF;}
> > .foo.fee{font-size:11px;}
>
> well matt, it seems like you've heard a half dozen different, partially
> conflicting, possibly overlapping, sometimes browser-dependent, and
> definitely inconsistent answers to your question
>
> james had an interesting comment:
>
> "While this [ie's inability to understand the multiple class selector]
> doesn't negate the value of being able to assign multiple classes
> to an element, it does diminish it."
>
> that's putting it mildly
>
> a lot of css will only work in the most recent browsers and you'd be wise
> to seek, um, simpler solutions
>
> to wit --
>
> patient: doc, it hurts when i do this!
> doctor: so, don't do it
>
> so maybe instead of --
>
> <div class="foo">
> <p>this should be FFFFFF</p>
> <div class="fee">
> <p>this should be 11px and it might be FFFFFF</p>
> </div>
> </div>
>
> you might analyze the situation and decide to declare your classes
> differently so that they do not rely on decendence or adjacency or
> childhood
>
> so instead of
>
> .foo{color:#FFFFFF;}
> .foo.fee{font-size:11px;}
>
> you might go with the tried-and-true
>
> .foo{color:#FFFFFF;}
> .foofee{ /* note class name is foofee */
> color:#FFFFFF;font-size:11px;}
>
> <div class="foo">
> <p>this should be FFFFFF</p>
> <div class="foofee">
> <p>this should be FFFFFF and 11px</p>
> </div>
> </div>
>
> anyhow, perhaps your question was only academic, rather than an immediate
> situation you're trying to solve
>
> in that case, check out the various selectors here --
>
> http://www.w3.org/TR/REC-CSS2/selector.html
>
> rudy
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list