Start at the beginning. If you want to style every "a" element on the page,
you can do:
a:link { color: red;}
If you want to style a particular link, you can do it using a direct id or
class applied within a link like this:
HTML - <a class="foo" href="#">text</a>
CSS - a:link.foo { color: green;}
Or using a descendant selector, where the id or class is used in the element
or container above:
HTML - <p class="foo"><a href="#">text</a></p>
CSS - .foo a:link { color: yellow;}
If you are having problems getting these to work, there is probably an issue
with specificity - meaning that you have written another a:link rule within
your css that is either more specific or appears after your current rule
within your style sheet.
The best thing to do is check through your css for all a:link rules and then
work out where the conflicts occur.
A really important step in all of this is to understand the document tree.
It may be worth drawing a basic document tree for your current page so you
can more easily see how to apply css to specific instances of an a element.
More on document tree here:
http://css.maxdesign.com.au/selectutorial/document_tree.htm
Russ
> Hi
>
> Can anyone tell me why when using classes sometimes I can style the a by
> itself (e.g. .myclass a) and other times this doesn't work and I have to
> style a:link (i.e. .myclass a:link)
>
> Any pointers would be appreciated.
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************