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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    My a:visited link is not working correctly.

    I am working on an assignment for my html5 web development class and I am having trouble with my navigation bar the color that I assign to the a:visited link ends up being the background color for the whole navigation links and it doesn't change when one has been visited. Here is my code :

    [#nav {
    padding: 5px;
    font-weight: bold;
    float: left;
    width: 160px;
    padding-top: 20px;
    padding-right: 5px;
    padding-bottom: 5px;
    padding-left: 20px; }
    #nav a { text-decoration:none;
    display: block;
    text-align: center;
    font-weight: bold;
    border: 3px outset #cccccc;
    padding: 5px;
    color: #ffffff;
    }
    #nav a:link { color: #ffffff;
    background-color: #000033; }
    #nav a:visited { background-color: #90c7e3; }
    #nav a:hover {border: 3px inset #666666;
    background-color: #3399cc; } ]

    So the visited link color is supposed to be #90c7e3 just like I have it written but instead it makes all of the navigation buttons that color and it does not change color when one of the links are visited. Also if I change that color it once again changes the whole navigation bar color rather then changing when a link is visited. I would really appreciate any help I could get because this is driving me a little crazy lol... :-)

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,465
    Thanks
    0
    Thanked 634 Times in 624 Posts
    Presumably you have visited all those pages recently enough for the browser to still remember the visit.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yes I have, but it just wont work right and I can not figure out what the problem is.

  • #4
    Regular Coder
    Join Date
    Mar 2012
    Posts
    168
    Thanks
    5
    Thanked 11 Times in 11 Posts
    Quote Originally Posted by Pamela88 View Post
    Yes I have, but it just wont work right and I can not figure out what the problem is.
    That is the answer to your problem, then. If every link is visited, the whole bar will show up as visited.

  • Users who have thanked KULP for this post:

    Pamela88 (03-17-2013)

  • #5
    New Coder
    Join Date
    Nov 2012
    Location
    India
    Posts
    53
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Just change the visited color to different color then your navigation background color.

  • #6
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I have tried reloading it to the server and clearing my cache also I pulled up the website on google chrome and internet explorer but the visited link color wont change if I click on a link.

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,667
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello Pamela88,
    Give us a link to the test site, or post your entire code, so we can see what is overwriting your :visited styling or why it won't work.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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