Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    May 2002
    Location
    Cleveland, Ohio, USA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Override CSS Link Color

    Howdy
    Is there a way to override the visited link and bullet set for an area on a webpage? The area that I wish to specify this is the area under the header and it's the only content besides the header. Although our CSS controls the colors for visited links, I would like to specify the visited link to appear in a different color such as red. Also, I would add a checkmark or the word completed next to the visited link. Each link goes to a different page which contains a web survey. Basically, I would like each user to visually see which survey they have already completed.
    Thanks and Smiles
    Kay
    <img src=/S/confused3.gif border=0 alt=confused3 width=45 height=45>

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Override CSS Link Color

    Hi Kay,

    This problem could have a number of possible solutions. The question is whether visiting the survey page is enough to warrant marking the page as completed. After all, it is possible for a user to visit the page without completing the survey then see the link show as visited/completed.

    Perhaps the next easiest method that comes to mind is using a cookie to indicate when a particular part of this survey is completed. Upon completion of the survey, send a cookie with a date/time stamp and any other necessary information. When viewing the menu page (the one in question) you can have the page check for the cookie then dynamically display the desired colors and text to indicate that part is completed. The biggest disadvantage of this would be if the user's browser does not accept cookies or if they delete the cookie at some point.

    Another method, which will require more work but provide better accuracy, is to data-drive the entire process. This assumes that you're currently tracking the user with some sort of login. As the user visits the menu page, you could check the database to determine which surveys have been taken, then dynamically render the desired color/text as needed.

    Hope this helps!

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Override CSS Link Color

    Here's some sample code that illustrates one way you can specify a different "visited" link color. It uses a DIV identified with a specific ID (in this case surv):

    <html>
    <head>
    <title>Visited links in two colors</title>
    <style>
    a:visited {color: black}
    #surv a:visited {color: red}
    </style>
    </head>
    <body>
    <h3>Normal links</h3>
    Google
    Microsoft
    Dilbert Archive
    <h3>Different Color When Visited links</h3>
    <div id="surv">
    Google
    Microsoft
    Dilbert Archive
    </div>
    </body>
    </html>

Posting Permissions

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