The bootstrap dropdown is hiding under the "main" page,

I have a problem displaying the .dropwdown boot class. He worked from the very beginning, but after a while he stopped. I use a fixed container as the "home page" on the website. It looks like this: http://imgur.com/NIfje It looks like when a button is clicked, as you can see in the little arrow.

I confirmed that the dropdown is working and there is nothing wrong with the .js file. Here is the body and im header using:

<body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <span class="brand">doost</span> <div class="nav-collapse collapse"> <ul class="nav"> <li><a href="<?php echo $logout; ?>">Logout</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">browse <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="<?php echo $random; ?>">random</a></li> </ul> </li> </ul> </div><!--/.nav-collapse --> </div> </div> </div> <div class="container"> 

I tried to reset / delete everything that could cause this problem, without being able to fix it. This includes replacing bootstrap.js / bootstrap.css by default. The main page consists of a fixed container that starts in the header and ends in the footer, and, as I said, is included in each page. I have several nested div tags inside this container that make up the website.

I also tried increasing the z-index for .dropdown in bootstrap.css, but nothing happened.

I use bootstrap.js / bootstrap.css by default, including one homecook.js / homecook.css file

Tell me if I need to provide anything else so you can help me. Thanks.

+4
source share
2 answers

I was able to solve this by putting a positive z-index value on a div with nav-collapse collapse classes. In my case, any value greater than 0 did the trick!

+5
source

I also had this problem. But when I tried my code, there were no problems. Have you included all the necessary plugin, for example bootstrap-dropdown.js ?

0
source

Source: https://habr.com/ru/post/1436975/


All Articles