SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS link states aren't changing color???

    I am trying to make my links change color in my blog, but nothing is changing. It seems as though the mainWrapper is controlling all of the links, but that is not what is suppose to happen. Could someone please have a look my css, and tell me why the commentlist links aren't changing to the color, that I need it to change to? Thanks in advance.

    Code CSS:
    #mainWrapper a:link, #mainWrapper a:visited {
    	color: #094457;
    	text-decoration: underline;
    }
     
    .commentlist:link, .commentlist:visited {
    	font: bold 1.2em;
    	color: #FFF;
    	text-decoration: underline;
    }

  2. #2
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    It seems as though the mainWrapper is controlling all of the links,
    Hi,
    From looking at your CSS that is exactly what's happening. The first set of rules have more specificity on them since there is an ID. Add that same ID to the second ruleset and it should work just fine for you.

    You only need the rules that are changing, you can omit the text-decoration.

    Code CSS:
    #mainWrapper a:link, #mainWrapper a:visited {
        color: #094457;
        text-decoration: underline;
    }
     
    #mainWrapper .commentlist:link, #mainWrapper .commentlist:visited {
        font: bold 1.2em;
        color: #FFF;
    }

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I have finally got the css links to work. With your help I changed the commentlist to #mainWrapper .commentlist a:link, #mainWrapper .commentlist a:visited, not #mainWrapper .commentlist:link, #mainWrapper .commentlist:visited {.

  4. #4
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    not #mainWrapper .commentlist:link, #mainWrapper .commentlist:visited
    That was assuming that there was an anchor with the class of .commentlist applied to it.

    a.commentlist

    You are correct in your adjustments though as you noted. The anchor is a descendant of .commentlist in your case.

    .commentlist a


Bookmarks

Posting Permissions

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