Re: How to define multiple CSS pseudo-classes?
by Tamara Abbey <tamara(at)abbeyink.com>
|
Date: |
Tue, 06 Mar 2001 11:29:37 -0600 |
To: |
Dane Robison <dane(at)strategic-design.com>, <hwg-techniques(at)hwg.org> |
References: |
autumnweb |
|
todo: View
Thread,
Original
|
|
At 09:10 AM 3/6/01 -0500, Dane Robison wrote:
>H1.red { color: #ff0000}
>H1.blue { color: #0000ff}
In here Dane, I would define h1 so it could be used anywhere. Then I would
have .red so when I wanted h1 in red, I would use h1 class="red". For me,
it's easier to keep track of because I may decide down the road to have red
text, and then p class="red" or td class="red" would work too and I
wouldn't have to update the CSS with a new class.
>...but I'm at a loss as to how I can apply this sort of technique to anchor
>tags. I tried these class selectors (in addition to the usual a:link):
>
>a:link.onblack
>a.onblack:link
Why not? Other than that there's no other definition in your example, they
should work:
a.onblack:link { color:black}
then a class="onblack" href="somepage.html" should turn the link text black
Also, if you're ever curious about whether or not a CSS class will work,
try the w3c validator and click to CSS -- it will analyze your css, tell
you what's wrong and then print out a lovely, valid sheet -- just be
careful with the *valid* sheet, if you did something wrong, it will throw
it out. But there have been many, many times when the CSS validator has
saved a handful or two of hair.
<Tamara />
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA