Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7781225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:09:33+00:00 2026-06-01T19:09:33+00:00

Using WordPress menu builder, I get the following code: //Pseaudo code <ul id=main-menu-main> <li

  • 0

Using WordPress menu “builder”, I get the following code:

  //Pseaudo code

  <ul id="main-menu-main">
    <li class="menu-item"><a></a></li>
    <li class="menu-item current-menu-ancestor">
      <a></a>
      <ul class="sub-menu">
        <li class="menu-item"><a></a></li>
        <li class="menu-item current-menu-item"><a></a></li>
      </ul>
    </li>
  </ul>


  // and I use the following CSS 
  #menu-main-menu a:hover { text-decoration: underline; }
  #menu-main-menu .current-menu-ancestor a { text-decoration: underline; }

The problem with my last css line, is that all a elements under current-menu-ancestor are underlined. I only want the link in current-menu-ancestor to be underlined.

I think this should be pretty simple, but right now my head is not focused :-/

The full code for parent / child looks like this:

<ul id="menu-main-menu" class="menu">
  <li id="menu-item-401" class="menu-item-first menu-item menu-item-type-post_type menu-item-object-page current-page-ancestor current-menu-ancestor current-menu-parent current-page-parent current_page_parent current_page_ancestor menu-item-401">
  <a>menu 1</a>    
  <ul class="sub-menu">
    <li id="menu-item-444" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-415 current_page_item menu-item-444">
    <a> sub 1</a>
    </li>
  </ul>
</li>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:09:34+00:00Added an answer on June 1, 2026 at 7:09 pm

    Use the following CSS snippet:

    #menu-main-menu .current-menu-ancestor > a { text-decoration: underline; }
    

    The > is the “child combinator”, and will only select direct children of the selector on its left.

    See here for an excellent round-up of child and sibling selectors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to add custom taxonomies to my menu in wordpress.
All, I'm using Wordpress so I know the main content falls within the following
I am using wordpress and on the page sidebar.php I have the following code:
As the title suggests... I'm setting up a superfish menu using the Wordpress CSS
I am using wordpress and use custom permalink structure: /%category%/%postname%/ My problem is that
I am using wordpress as my cms and building a website. I use Graphene
Im using the secondary menu option in wordpress like this... <?php wp_nav_menu( array( 'theme_location'
I'm looking for the correct way of using wp_get_attachment_image(). The following code: <?php $args
So I am using Jquery to display a pop up menu on my current
We are using the WordPress with Superslide show, the problem is menu is hiding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.