WordPress.org

Ready to get started?Download WordPress

Forums

Can't change color of secondary menu (4 posts)

  1. denutza
    Member
    Posted 1 year ago #

    I created a secondary menu and when I change the CSS, it changes both primary and secondary menu color (Im clueless with CSS).

    function secondary_menu() {?>
    
    <div id="sec_nav_area" class="full_width">
    <div class="page">
    <?php
    wp_nav_menu( array( 'container_class' => 'secondary_menu', 'theme_location' => 'secondary' ) );
    ?>
    </div>
    
    </div>
    <?php
    
    }
    add_action('thesis_hook_before_content_area','secondary_menu');

    This CSS will change both (but I only want the secondary to change:

    .custom .menu, .menu a, .menu li ul {
    background:#cf3443;
    }

    This CSS only effects outer width:

    .custom #sec_nav_area, .custom #sec_nav_area li ul{background-color: #64a9be !important; border: 0; }

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    Try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

  3. denutza
    Member
    Posted 1 year ago #

    Actually I had tried that..my problem is I just don't know how to apply it.

    It shows

      #menu-primary .menu when I hover over the top menu.

      It shows

      #menu-secondary. menu when i hover over secondary menu.

      (Im a major CSS dummy)

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Use the menu specific id in any style for that menu only:

    #menu-secondary other selectors here {
     ...
    }

    See http://www.w3schools.com/cssref/css_selectors.asp

Topic Closed

This topic has been closed to new replies.

About this Topic