Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Anchor Tag Conflicting with h2 Properties

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42091
    mintertweed
    Participant

    I am creating a WordPress website. Currently, the anchor tag is set to a mid-green color and I would like all of my links to be this color. Except for my titles for my blog posts, which is subsequently a link and an h2. I just found out today that even if I give a color property of white to my h2, it will be overridden by my anchor tag properties. So, with that said, I need to know how to make my blog posts white. Here is the code I am dealing with…

    Anchor:

    a {
    font-size: 1em;
    outline: none;
    color: #A7BC60;
    transition: all 0.3s ease-in;
    -webkit-transition: all 0.3s ease-in; /*Safari & Chrome*/
    -moz-transition: all 0.3s ease-in; /* Firefox 4 */
    -o-transition: all 0.3s ease-in; /* Opera */
    text-decoration:none;
    }

    h2:

    h2 {
    font-size: 2em;
    font-family: ‘Arvo’, serif;
    font-weight: normal;
    color: #FFFFFF;
    text-shadow: 0px 2px #A7BC60;
    }

    And finally, the HTML and PHP:

    “>

    I feel like this is something easy, but I have not been able to figure out how to bypass the anchor tag and use the properties for the h2. Thank you in advance!

    #121426
    TheDoc
    Member

    h2 a {
    color #fff;
    }

    #121445
    theacefes
    Member

    [You sure?](http://codepen.io/katbella5/pen/mCesK “Works for me.”)

    #121447
    theacefes
    Member

    Sweet!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.