1
I want the sub-menu to have one more layer of menu. I made the Christian code that would work, however, when passing the mouse in the first sub-menu of the menu (Protectors > Motor), the options of the second sub-menu layer of the "Lighthouse" option are being opened together. How do I fix this?
.menu-categories {
height: 50px;
}
.menu-categories ul {
height: 50px;
display: inline-block;
font-family: helvetica;
font-weight: bold;
position: relative;
;
margin-left: 5px;
margin-top: 0px;
padding: 0px;
}
.menu-categories ul a {
display: inline-block;
background: gold;
text-align: center;
font-size: 12pt;
color: black;
width: 120px;
padding: 15px;
text-decoration: none;
}
.submenu-items {
width: fit-content;
margin-top: 2px;
position: absolute;
display: none;
}
.submenu-items li {
width: fit-content;
height: fit-content;
margin-top: 2px;
list-style: none;
position: relative;
}
.submenu-items li a {
width: 120px;
padding: 15px;
margin-top: 0px;
text-align: center;
border-right: solid black 3px;
}
.deep-menu {
display: none;
width: 200px;
height: 5px;
}
.deep-menu ul {
height: fit-content;
left: 150px;
bottom: 50px;
}
/* As caixas do menu, "menu-categories", contém a rolagem,
e citando a classe "sub-menu items" ela será de rolagem individual */
.menu-categories ul:hover .submenu-items {
display: block;
}
.submenu-items a:hover {
background-color: rgb(255, 115, 0);
}
.menu-categories div:hover .deep-menu {
display: block;
}
<div class="menu-categories">
<ul><a href="protetor.html">Protetores</a>
<div class="submenu-items">
<li><a href="prot-motor.html" title="Protetores de motor">Motor</a></li>
<div class="deep-menu">
<ul>
<li><a href="protetormotorcg" title="Protetor Honda CG">Honda CG 125/150/160</a></li>
<li><a href="protetormotorxre" title="Protetor Honda XRE">Honda XRE 300</a></li>
</ul>
</div>
<li><a href="prot-farol.html" title="Protetores de farol">Farol</a></li>
<div class="deep-menu">
<ul>
<li><a href="protetorfarolfactor" title="Protetor de Farol Factor">Yamaha Factor</a></li>
<li><a href="proetorfarolcb300" title="Protetor de Farol XRE">Honda CB300</a></li>
</ul>
</div>
<li><a href="prot-carenagem.html" title="Protetores de carenagem">Carenagem</a></li>
</div>
</ul>
<ul><a href="escapamento.html">Escapamentos</a>
<div class="submenu-items">
<li><a href="competition.html" title="Escapamento Competition">Competition</a></li>
<li><a href="usaracing.html" title="Escapamento U.S.A. Racing">U.S.A. Racing</a></li>
</div>
</ul>
<ul><a href="capacete.html">Capacetes</a>
<div class="submenu-items">
<li><a href="protorkcapacete.html" title="Capacetes Pro Tork">Pro Tork</a></li>
<div class="deep-menu">
<ul>
<li><a href="g6788.html" title="Capacete G6 788">G6 788</a></li>
<li><a href="newliberty.html" title="Capacete New Liberty Four">New Liberty Four</a></li>
</ul>
</div>
</div>
</ul>
</div>
To proceed with the doubt is important [Dit] the question and exchange the code for a [mcve] of the problem. To understand what kind of question serves the site and, consequently, avoid closures and negativities worth reading What is the Stack Overflow and the Stack Overflow Survival Guide (summarized) in Portuguese.
– Bacco