WordPress.org

Ready to get started?Download WordPress

Forums

Portfolio Press
[resolved] Current Menu Item text color (4 posts)

  1. brittanyannebrown
    Member
    Posted 11 months ago #

    Hi there. I am trying to change the color of the text on a menu item when it is on that page. The text of my menu items are black but when it is on that specific page I want it to be white text. I tried this in my CSS:

    .current-menu-item a {
    color: #FFFFFF;
    }

    But it does not change it. Any suggestions??

  2. paulwpxp
    Font hero
    Posted 11 months ago #

    It's because that parent theme is using a more specific selector, so yours couldn't overide it. Just put more weight on your selector to win it out.

    #navigation .current-menu-item a,
    #navigation .current_page_item a {
    	color: white;
    }

    The page one, I suppose it is for when it's a page, so just put it there.

  3. brittanyannebrown
    Member
    Posted 11 months ago #

    PERFECT! Thanks so much!!! I felt like I tried everything and that worked! Since I am working with a child theme I had to add "!important" after the color for it to show up and override the parent. This is how I put it in the CSS:

    #navigation .current-menu-item a,
    #navigation .current_page_item a {
    color: #FFFFFF !important;
    }

  4. paulwpxp
    Font hero
    Posted 11 months ago #

    hmm, I think that should do it without the !important bit.

    I tested it at this page ( so current item is "about" )
    http://themes.wptheming.com/portfolio/about/

    and in Firebug, I put those 2 lines in at the bottommost of the main style.css which is the same thing as below the @import line of childtheme's style, and it works, it changes color of "about".

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.