We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11030
    • 21 Posts
    Hi there,
    I’m having trouble getting my hyperlinks to follow the colours i have set for them.
    Included in my CSS file is the following code
    a:link {color:#164e11;}
    a:visited {color:#164e11;}
    a:focus {color:#2e8d26;}
    a:hover {color:#2e8d26;}
    a:active {color:#2e8d26;}


    This works fine offline, but for some reason this coding doesn’t go down well with ModX. The webpage just refers back to the default settings for hyperlinks.

    Any suggestions?

    Thanks for looking
      • 26931
      • 2,314 Posts
      Hi there,

      add a # to the value -> a:active {color:#2e8d26;}
        • 11030
        • 21 Posts
        sorry my bad, i did have them in their, but i took them out while i was experimenting with something.

        It doesn’t work with them in place
          • 16183
          • 1,390 Posts
          Hi,

          Sometimes it is better to be more specific in your CSS rules, e.g.

          li a:link {color:#164e11;}
          li a:visited {color:#164e11;}
          li a:focus {color:#2e8d26;}
          li a:hover {color:#2e8d26;}
          li a:active {color:#2e8d26;}


          If the parent/grandparent element for li has an id, be even more specific by using that in your rules. Specificity has helped me solve similar problems in the past.

          cheers/k