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

  • Home
  • SEARCH
  • 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 7885873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:10:51+00:00 2026-06-03T05:10:51+00:00

I’m having trouble with z-index in IE 7. The problem is that the menu

  • 0

I’m having trouble with z-index in IE 7. The problem is that the menu items are in 2 rows. If any of first row item has sub-menu, the IE7 won’t let you hover it. The problem is caused by IE7 only.

Here’s my code:

<div id="wrapper">

    <div id="main-nav">
        <ul class="main-menu" id="menu-header-menu">
            <li class="menu-item"><a href="#">item 1</a>
                <ul class="sub-menu">
                    <li class="menu-item"><a href="#"> sub item</a>
                        <ul class="sub-menu">
                            <li class="menu-item"><a href="#">sub sub item</a></li>
                            <li class="menu-item"><a href="#">sub sub item</a></li>
                        </ul>
                    </li>
                </ul>
            </li>

            <li class="menu-item"><a href="#">item 2</a></li>
            <li class="menu-item"><a href="#">item 3</a></li>
            <li class="menu-item"><a href="#"> test item</a>
                    <ul class="sub-menu">
                        <li class="menu-item"><a href="#">sub sub item</a></li>
                        <li class="menu-item"><a href="#">sub sub item</a></li>
                    </ul>
            </li>
        </ul>
    </div>  
</div>

CSS:

#wrapper {
    width:250px;
    margin:0 auto;

}
#main-nav { 
    background-color:orange;
    padding: 0 10px;    
    clear: both;
    display: block;
    float: left;
    width: 100%;    
}

#main-nav ul {  
    list-style: none;
    margin: 0 0 0 -0.8125em;
    padding-left: 0;
}
#main-nav li {
    float: left;
    position: relative; 
}

#main-nav a {
    color:#737373;
    display: block;
    line-height: 2.333em;
    padding: 0 1.2125em;
    text-decoration: none;
}
#main-nav ul ul {   
    display: none;
    float: left;
    margin: 0;
    position: absolute;
    top: 2.333em;
    left: 0;
    width: 188px;
    z-index: 999;
}
#main-nav ul ul ul {
    left: 100%;
    top: 0;
}
#main-nav ul ul a {
    background: yellow;

    height: auto;
    line-height: 1.4em;
    padding: 10px 10px;
    width: 168px;
}

#main-nav li:hover > a,
#main-nav a:focus {
    color: #373737;
}

#main-nav ul li:hover > ul {
    display: block;
}

Here you can see the problem. When you hover on the item 1, it does not let me hover its sub item which has yellow background.

enter image description here

  • 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-03T05:10:53+00:00Added an answer on June 3, 2026 at 5:10 am

    Easy fix. Add this to the bottom of your css code:

    #main-nav ul li:hover {z-index:9999;}
    

    The problem is that your element needed a higher z-index upon hovering, not before.

    Here’s a live link to a demo I uploaded. Works on both ie7 and ff/chr/saf:

    http://sotkra.com/stackoverflow/ie7zindex/index.html

    I nonetheless suggest you simplify your code, it’s too clunky. There is a tiny bug where once you hover your 3rd layer menu, exit and then re-enter, the yellow background will be there. Should be fixed with a proper cleanup of your html/css

    Cheers

    G

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
I have a small JavaScript validation script that validates inputs based on Regex. I
I am currently running into a problem where an element is coming back from

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.