[lug] OT: CSS2, mixing pseudo-class with class

Rob Judd rjudd at mlug.missouri.edu
Fri Sep 27 09:12:32 MDT 2002


> I'm trying to figure out if I can modify my CSS2 stylesheet. Currently
> it has A:visited and A:link to adjust colors, but I wanted to have a
> second class of <A> "anchor" tags, within a list, and I wanted this to
> be a new class, e.g., class "foo", with different color attributes. Is
> there a way to have both a general CSS2:
> A:visited {
> ...
> }
> A:link {
> ...
> }
>
> ...and also a specific:
> A:visited.foo {
> ...
> }
> A:link.foo {
> ...
> }
>
> So far I haven't found a valid way to mix :link and :visited pseudo-tags
> with my own class name. Perhaps it isn't even possible.

I believe that the correct syntax to have a class foo with different
attributes is:

A.foo:visited {
...
}

A.foo:link {
...
}

(this is from the O'Reilly CSS book, p157).

Cheers, Rob




More information about the LUG mailing list