WordPress.org

Ready to get started?Download WordPress

Forums

Leaf
[resolved] Selected menu item (6 posts)

  1. NCRoma
    Member
    Posted 1 year ago #

    Newbie question incoming:

    I wish to find the css anotation for the main navigation menu selected item, so I can put in some color on the text. Any tips of where it is in the style.css?

    Many thanks!

  2. haltas
    Member
    Posted 1 year ago #

    In your style.css change these:

    .main-navigation li a:hover {
    	color: #yourcolor;
    }

    for the main navigation on mouse over

    .main-navigation li ul li a:hover {
    	background: #444;
    	color: #yourcolor;
    }

    for the drop down-menu on mouse over
    and

    .main-navigation .current-menu-item > a,
    .main-navigation .current-menu-ancestor > a,
    .main-navigation .current_page_item > a,
    .main-navigation .current_page_ancestor > a {
    	color: #yourcolor;
    	font-weight: bold;
    }

    for the current page or category

    If you want to have the current sub-category also to be highlighted with a custom color,
    also change this:

    .main-navigation .sub-menu .current-menu-item > a,
    .main-navigation .sub-menu .current-menu-ancestor > a,
    .main-navigation .sub-menu .current_page_item > a,
    .main-navigation .sub-menu .current_page_ancestor > a {
    	color: #yourcolor;
    }

    replace 'yourcolor' with the color of your choice. Should work :) Let me know

  3. esmi
    Forum Moderator
    Posted 1 year ago #

    No! Do not edit the theme itself. First create a child theme for your changes. Or install a custom CSS plugin.

  4. haltas
    Member
    Posted 1 year ago #

    For the hex color code, I think it´s the best to use the accent color of your website, which is defined in Leaf Options.

  5. NCRoma
    Member
    Posted 1 year ago #

    Resolved! Sadly I am far too into this to go and start all over again in a child theme :( But next time I'll know that is the right thing to do! Thanks!

  6. kristygardner
    Member
    Posted 1 year ago #

    very helpful!!! thank you!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic