Dropdown menu does not overwrite and background div

Asked

Viewed 246 times

0

The problem is this, I have a header with a background, I have a menu bar in this header, this menu bar has an item with dropdown, but when I call the dropdown it appears below but is cut when the background reaches the end, not appearing all, I tried to use the properties position and z-index in various classes kk na from the menu, on the menu parent, but I did not get result, follow the code with the structure qe am using, I removed the content from the Ivs I only left the structure to understand how this:

<div class="**fundo-header** col-md-12">
    <div class="container">
        <div class="col-md-12 retira-padding conteudo-header">
        <div class="col-md-4 retira-padding">
        </div>
        <div class="col-md-8 retira-padding">
            <div class="col-md-8 retira-padding conteudo-header-2">
            </div>
            <div class="col-md-4 retira-padding icones-redes-sociais">
            </div>
            <div class="col-md-12 retira-padding menu-header">
                <nav  class="navbar navbar-default">            
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
                            <span class="sr-only"></span> 
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span> 
                        </button>
                    </div>  
                    <div class="collapse navbar-collapse" id="navbar">
                        <ul class="nav navbar-nav">
                            <li><a href="">Home</a></li>
                            <li class="**dropdown**">
                                <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Estoques<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="" class="tamanho-drop">Caminhões</a></li>
                                    <li><a href="" class="tamanho-drop">Carretas</a></li>
                                    <li><a href="" class="tamanho-drop">Carros</a></li>
                                    <li><a href="" class="tamanho-drop">Ônibus</a></li>
                                </ul>
                            </li>   
                            <li><a href="">empresas</a></li>
                            <li class="dropdown">
                                <a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Financiamentos<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="" class="tamanho-drop">Consórcios</a></li>
                                </ul>
                            </li>   
                            <li><a href="">Consultas</a></li>
                            <li><a href="">Contato</a></li> 
                        </ul>
                    </div>               
                </nav>
            </div>
        </div>
    </div>
</div>

css

 .fundo-header{
background-color: #ccd2d5;
z-index: 1;
position: relative;
}

.menu-header{
position: absolute;
z-index:99;
top:100px;
}
  • Guy just with what you posted I could not simulate the error here. Would you edit with an image of how you are getting on the screen? Or a link if you have

  • https://uploaddeimagens.com.br/imagens/erro-jpg-8df601a7-eede-43eb-9081-9336ae5ebf5f

  • the dropdown should override the gray background, which is the background-header ; I was told here that the background-header tbm should be with position Absolute but I tried and continues to work

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.