Looking to create a hover/drop menu using DIVs without UL/LI elements. The current menu displays 3 options, but I want to add a submenu under Link 2.
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 0px;
font-size: 12px;
border: none;
cursor: pointer;
}
.dropdown {
margin-top:200px;
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 30px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
...
<div class="dropdown">
<button class="dropbtn">^</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
</div>
Desiring the following structure:
<div class="dropdown">
<button class="dropbtn">^</button>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<div class="submenu">
<a href="#">SubLink 1</a>
</div>
<a href="#">Link 3</a>
</div>
</div>
Require SubLink 1 to appear when hovering over Link 2. Have attempted multiple solutions without success, seeking assistance from others.