Web Analytics Made Easy -
StatCounter Links and CSS's - CodingForum

Announcement

Collapse
No announcement yet.

Links and CSS's

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Links and CSS's

    Hello, what I want to do seems to should be simple (not sure, I am writing my first style sheet). I want change the properties of all links, but protect a few. I have tried to use the following:

    a:hover { color: blue }
    a .protected:hover { color: white }

    I want all links to be blue, expect those in protected class. The above example turns all links blue. I could create two unique classes (not use the 'a') but I don't want to protect the vast majority of my links. If a guru doesn't have the answer, I might just write it in locally since the protected links are in a templete.

    Thanks a bunch.-Luke

  • #2
    Ok, you should define your links in all states (IE: link, active, visited,hover) in CSS to get a consistant result. For what you're trying to do, try this:

    A:link {color: #0000ff;}
    A:active {color: #0000ff;}
    A:visited {color: #0000ff;}
    A:hover {color: #0000ff; }

    A.protected:link {color: #ffffff;}
    A.protected:active {color: #ffffff;}
    A.protected:visited {color: #ffffff;}
    A.protected:hover {color: #ffffff; }

    Then in the links you want to be white, you add the 'protected' class like this:

    <a class="protected" href="whatever.html">White Link</a>

    Does this help? Good luck .
    boxer_1
    CodingForum Moderator
    "How did a fool and his money get together in the first place?"

    Comment


    • #3
      Yah, that is perfect. Thanks a lot man. -Luke

      Comment


      • #4
        Originally posted by lukec
        Yah, that is perfect. Thanks a lot man. -Luke
        You're welcome, glad it helped you out ! Should you wish to further you CSS knowledge, here's a good all 'round resource: http://www.w3.org/Style/CSS/ and, of course, you know where to come with any questions you may have in the future .
        boxer_1
        CodingForum Moderator
        "How did a fool and his money get together in the first place?"

        Comment

        Working...
        X