I am having trouble with displaying the dropdown menu when hovering over the class (dropbtn). I tried adding .dropdown:hover .dropdown-content-strategy{..} but it's not working as expected. If I do manage to show the dropdown menu, it stays visible even when I hover outside of it.
#dropdown {
overflow-y: hidden;
position: relative;
width: 14%;
height: 51vh;
z-index: 99999999999999999999999999999999999;
}
.dropbtn{
position: relative;
left: 21%;
}
.dropdown-content-strategy{
overflow-y: hidden;
display: none;
position: relative;
background-color: #e2f1d9;
z-index: 99999999999999999999999999999999999;
}
.dropdown-content-strategy a{
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
z-index: 99999999999999999999999999999999999;
}
.dropdown-content-strategy a:hover{
background-color: #ddd;
}
.dropbtn:hover .dropdown-content-strategy{
display: block;
}
<div id="dropdown" class="animate__animated animate__rollIn" >
<h3 class="dropbtn">STRATEGY</h3>
<div class="dropdown-content-strategy">
<a href="Short Straddle with Divisor Based SL.html">Short Straddle with Divisor Based SL</a>
<a href="short straddle sl.html">Short Straddle with Trailing SL</a>
<a href="straddlesimple.html">09:20 Straddle (Simple)</a>
<a href="straddle shift sl.html">09:20 Straddle (Shift SL to Cost)</a>
<a href="straddle roll the pending.html">09:20 Straddle (Roll the Pending Leg)</a>
<a href="index combo.html">Index Combo</a>
<a href="index option buying.html">Index Option Buying</a>
</div>
<br><br><br><br><br><br><br><br><br>
</div>
Would appreciate any assistance on this matter. Thank you.