.menuAbrir,
.menuFechar {
display:none;
}
.menuPrincipal li {
display:inline;
position: relative;
}
.menuPrincipal li a{
display:inline-block;
vertical-align:middle;
text-align:center;
width:115px;
line-height:70px;
font-size: 20px;
transition: background-color 1s;
}
.menuPrincipal li a:hover {
background-color: #63C4D3;
color: #FFFFFF;
}
.menuPrincipal li:hover > .sub-menu{
display:block;
}
.sub-menu {
display:none;
position:absolute;
}
.sub-menu li {
display:block;
}
<ul class="menuPrincipal">
<li><a id="mnHome" href="index.php">HOME</a></li>
<li><a id="mnPesquisa" href="#">LOJA</a>
<ul class="sub-menu">
<li>Teste</li>
</ul>
</li>
<li><a id="mnContato" href="../contato.php">CONTATO</a></li>
<li><a id="mnSobre" href="../sobre.php">SOBRE</a></li>
</ul>
The problem is that the submenu drops below the first li
and not below its corresponding li
.
What to do?