Strange CSS issues.. can't overwrite a:visited color

Discussion in 'CSS' started by KC TAN, May 26, 2008.

  1. #1
    Hi, I have tried to figure this out for the whole afternoon but still couldn't get it solved..

    I am trying to set the a:visited link to color, #726D6A but it just keeps showing white color which is the value in the div, topn, which has been closed earlier.

    The CSS codes are:

    
    div#topn a:link, a:visited { /* template.css (line 79) */
    color:white;
    text-decoration:none;
    }
    
    a:link, a:visited { /* template.css (line 24) */
    color:#726D6A;
    font-weight:normal;
    text-decoration:underline;
    }
    
    Code (markup):
    The link in my text shows white color upon visited and this is not what I intended.. I am expecting the visited link to have the color of #726D6A.

    To get the picture of what I mean, you can take a look at the text, HERE, at:
    http://www.yongsak.com/

    I appreciate any help and comments, thank you.
     
    KC TAN, May 26, 2008 IP
  2. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Here's your problem:
    div#topn a:link, [B]a:visited[/B]
    Code (markup):
    That should actually read:
    div#topn a:link, [B]div#topn a:visited[/B]
    Code (markup):
    When declaring multiple classes at a time, you still need to repeat their complete parents or the browser will interpret it as "apply this style to links in topn and well as all visited links".
     
    steelfrog, May 26, 2008 IP
    KC TAN likes this.
  3. KC TAN

    KC TAN Well-Known Member

    Messages:
    4,792
    Likes Received:
    353
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Thank you, steelfrog :)

    This solves the issue :D
     
    KC TAN, May 26, 2008 IP
  4. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Glad I could help! :D
     
    steelfrog, May 26, 2008 IP