I made the following menu in css and the opening / closing is normal, but when I click on any submenu items, the menu closes before redirecting.
Would you have some way around this?
#menu {
position: relative;
float: left;
display: inline-block;
margin: 10px 100px;
}
.item {
font-family: 'Open Sans', sans-serif;
position: relative;
display: inline-block;
font-size: 12.5px;
color: #969696;
margin-left: 30px;
cursor: pointer;
}
.open-button {
display: block;
width: 100%;
background-image: url(../../img/select-arrow-down.png);
background-repeat: no-repeat;
background-position: top right;
padding-right: 20px;
}
.open-button:focus {
pointer-events: none;
}
.open-button:focus + ul {
display: block;
}
ul {
position: absolute;
display: none;
top: 40px;
right: -20px;
width: 200px;
z-index: 10;
border-radius: 5px;
box-shadow: 0px 4px 6px #ccc;
background-color: #fafafa;
}
li {
position: relative;
float: left;
display: inline-block;
width: 100%;
}
a {
position: relative;
float: left;
display: inline-block;
width: 100%;
height: 36px;
line-height: 36px;
padding: 0 25px;
}
a:hover {
background-color: #f0f0f0;
text-decoration: none;
}
<nav id="menu">
<div class="item">
<span class="open-button" tabindex="0">Menu</span>
<ul>
<li>
<a href="{{ route('cliente-conta') }}">Meus dados</a>
</li>
<li>
<a href="{{ route('pedidos') }}">Meus pedidos</a>
</li>
<li>
<a href="{{ route('cliente-logout') }}">Sair</a>
</li>
</ul>
</div>
</nav>