links color

  • Unknown's avatar

    Hello,

    I know the CSS code to change links color and backgrounds, but I can’t figure out how to change the color of my links in the menu only. I’d like to have a menu with a black background and white links, that would change to a yellow background with black font on hover. However, it seems like when I try to change the link color, all my links change color and I don’t want that. I tried to use the “inspector” to figure out the correct codes but was sadly unsuccessful. Thanks for your help.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there, you are actually pretty close with what I see in your custom CSS. Change .nav-menu a to the following

    .main-navigation li a {
        font-size: 12px;
        padding: 0 5px;
        color: #fff;
    }

    and change your .nav-menu rule to have a black background color, like this.

    .nav-menu {
        background-color: #000;
    }

    I see an orange text color on hover right now. To have a yellowish background and black text on hover, add the following.

    .main-navigation li a:hover {
        color: #000;
        background-color: #ffff33;
    }
  • Unknown's avatar

    Thanks a lot! I was missing the li :)

  • Unknown's avatar

    You are welcome, and we all miss things like that from time to time. :)

  • The topic ‘links color’ is closed to new replies.