1

I've got a class

    .text2{
    font-size: 1.2em;
    color: #473f37;
    padding-bottom: 0.3em;
    }

I want text of links to appear white within this class, how do I do it?

<div class="text2">
  <a href="notice">Notices</a>
</div>

I tried the below and it not working

.text2 a:link{
    color: white;
}
2
  • Is this a trick question? And what would you need a pseudo-selector for? Can you provide some markup? Commented Oct 5, 2009 at 14:21
  • no trick question, i'll update the question to have my markup
    – conspirisi
    Commented Oct 5, 2009 at 14:27

1 Answer 1

4
.text2 a { color: #ffffff; }
2
  • thanks but, don't I need the 'link' part below? text2 a:link { color: #ffffff; } anyway, with or without 'link', it's not working for me.
    – conspirisi
    Commented Oct 5, 2009 at 14:25
  • No, unless you were specifying a separate colour for the different link states; then you'd need a rule for a:link, a:hover, a:visited and a:active. The fact that it's not working sounds like a specificity issue to me - think about where else in your CSS you are specifying link colours (which could be overriding it).
    – Mark Bell
    Commented Oct 5, 2009 at 14:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.