简体   繁体   中英

Mobile menu not showing correctly

I'm trying to make a "mobile navigation menu".

I'm following this CSS Dropdown Menu (look at CSS Drop Down menu paragraph and its resources).

When i click to "Menu" button to open my menu, submenu voices override "Menu" button, so i cannot close menu when it's opened.

Here's my CSS code:

@media screen and (max-width: 960px) {
    #access .nav-toggle{
        display: inline-block;
        float: left;
        position: relative;
        width:50%;
    }

    #menu-navigazione {
       position: absolute;
       z-index: 10000000;
       display: block;
       width:40% !important;
    }

    #menu-navigazione li {
       display: block;
    }

    #menu-navigazione li a {
       display: block;
    }

And this is my HTML structure

<a class="nav-toggle" href="#">Menu</a>
<div class="menu-navigazione-container">
 <ul id="menu-navigazione" class="menu" style="display: block;">
  <li><a href="#">Some content HERE</a></li>
  <li><a href="#">Some other content HERE</a></li>
 </ul>
</div>

Where am i doing something wrong?

Thanks!

use this css

.menu-navigazione-container {
   position: relative;
}
#menu-navigazione {
   position: absolute;
   z-index: 10000000;
   display: block;
   width:40% !important;
   top:42px;
   left:0px;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM