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 626573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:26:01+00:00 2026-05-13T19:26:01+00:00

I have a menu uses nested unordered lists to give the appearance of a

  • 0

I have a menu uses nested unordered lists to give the appearance of a secondary dropdown menu. This is working well for the most part. I recently refactored the CSS code to make it cleaner and easier for me to understand, but now I can’t seem to get the secondary (dropdown) menu to appear behind the top-level menu. Both elements have positions declared.

The HTML is fairly straightforward and I don’t think there’s any problem here:

<div id="header-menu">
    <ul>
        <li><a href="#">what</a></li>
        <li><a href="#">what</a>
            <ul>
                <li><a href="#">what</a></li>
                <li><a href="#">what</a></li>
                <li><a href="#">what</a></li>
            </ul>
        </li>
        <li><a href="#">what</a></li>
        <li><a href="#">what</a></li>
        <li><a href="#">what</a></li>
    </ul>
</div>

The CSS, however, is doing things that I don’t really understand.

    #header-menu > ul > li {
        font-size: 2em;
        display: inline;
        position: relative;
        }

    #header-menu > ul > li:hover {
        background: #a4b0ac;
        padding: 25px 0;
        }

    #header-menu > ul > li > a {
        padding: 25px;
        position: relative;
        z-index: 100;
        }

    #header-menu li > ul {
        display: none;
        position: absolute;
        z-index: 99;
        background: #CC6601;
        }

    #header-menu li:hover > ul {
        display: block;
        }

    #header-menu li ul > li {
        font-size: 0.8em;
        display: block;
        position: relative;
        }

    #header-menu li ul > li a {
        padding: 10px;
        display: block;
        }

    #header-menu li ul > li a:hover {
        background: #a4b0ac;
        display: block;
        }
  • 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-05-13T19:26:01+00:00Added an answer on May 13, 2026 at 7:26 pm

    EDIT: Misread your question initially.

    You can’t put different z-indexes (z-indices?) on elements that are nested in that way because inside of one element cannot hide behind itself while the rest of it shows. You’ll have to un-nest these and then apply the z-index, or remove the conflicting reference in the first z-index applied to <a>.

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

Sidebar

Related Questions

I have a web part which uses many SharePoint controls like menu, SPGrid, tool
I currently have a CSS <ul><li> dropdown menu that uses the following code. Unfortunately
Hi guys I have put together a simple dropdown menu system that uses hoverIntent
I have a menu that uses SSIs, problem is the tag needs an id
I have a site that uses a menu control tied to a sitemapdatasource which
I have built a drop-down menu here http://dev.driz.co.uk/jsonmenu/ that uses JSON to dynamically build
Gday All, I know this issue is well known, however I have searched high
I have an accessibility skip nav menu that uses named anchors to jump to
I have a page with a menu that uses JQuery AJAX calls to populate
I have a horizontal menu that uses spans to display a horizontal subnav directly

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.