Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Links and CSS's

  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry 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
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    574
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yah, that is perfect. Thanks a lot man. -Luke

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    574
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •