Forum Moderators: open
I want to add a different style to the active link but a:active doesn't work..any options?
Ok, back to css....
There might be many reasons why 'styling' is not working. When in doubt go to spec:
[w3.org...]
you can also validate your css (report will point point out where the errors might be):
[jigsaw.w3.org...]
Not sure which version of CSS you are working with but this should work on any:
A:link { color: blue } /* unvisited link */
A:visited { color: red } /* visited links */
A:active { color: lime } /* active links */ [w3.org...]
an example of common mistake
...a style sheet can legally specify that the 'font-size' of an 'active' link should be larger than a 'visited' link, but the UA is not required to dynamically reformat the document when the reader selects the 'visited' link
If you read through specs, tried to validate you css and still can't figure it out, post again with your css code.
HTH
[edited by: Tastatura at 8:29 am (utc) on Dec. 27, 2007]
I want to add a different style to the active link but a:active doesn't work..any options?
You may be getting mixed up with what the :active pseudo class actually is? From Tastatura's W3C link above:
W3C: An 'active' link is one that is currently being selected (e.g. by a mouse button press) by the reader.
ie. It doesn't stay 'active' when focus moves off it. If I remember correctly you might also need to style a:focus for a cross-browser (ie. in Firefox) effect (?)