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 5 of 5
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Cant get these anchors to change color! Arg!

    So I have a really convoluted site, css-wise, that I really need to clean up one o these days. It started out with editing an existing template, and then has been added to over the years, piecemeal, as I've added plugins and made changes to the site. The result is kind of a mess but it at least seems to display right.

    Except for one thing. I want links that are in h1, h2, or h3 tags to be black, not the current brown color they're showing. I've tried several things but can't seem to get it to work. I've even put a class on the h3 tag itself and tried to turn it black but it just won't do it.

    I never "learned" CSS officially, I've just picked it up along the way, so there are huge gaps in what I know.

    Anyway, the site is here: http://opalcat.com/ all those links that are titles of articles should be black, but they're not.

    Style sheet is here: http://opalcat.com/css.php?n=default (some of the stuff I tried is near the top in the links area, some is at the very very bottom)

    Any help?

  • #2
    Regular Coder
    Join Date
    Jul 2011
    Location
    India
    Posts
    496
    Thanks
    3
    Thanked 57 Times in 56 Posts
    Use following code:
    Code:
    h1 a, h2 a, h3 a {
    
    color:#000 !important;
    text-decoration:underline; /*you can change it to none if you don't want underline */
    
    }

  • #3
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,343
    Thanks
    11
    Thanked 288 Times in 287 Posts
    In your css, if you change:
    Code:
    h1 a, h2 a, h3 a
    to:
    Code:
    #content h1 a, #content h2 a, #content h3 a
    It should work.
    Dave

    Oops, now you have two options

  • #4
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    here's a few good reads on css specificity for some learning- t is probably one of the most confusing things about css for alot of folks.

    http://coding.smashingmagazine.com/2...u-should-know/
    http://css-tricks.com/855-specifics-on-css-specificity/
    http://www.htmldog.com/guides/cssadvanced/specificity/

    Hey also you should try out firefox with the firebug plugin installed, it helps pinpoint problems liek these very quickly. see the links in my signature.

  • #5
    New Coder
    Join Date
    Aug 2011
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thanks everyone, I will try that stuff. Sorry for being so late to respond--I didn't realize this forum didn't automatically subscribe you to threads you posted in so I thought nobody had responded when I didn't get an email! Whoops! Changed my settings now.


  •  

    Tags for this Thread

    Posting Permissions

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