My attempt at creating a smooth drop-down menu using HTML and CSS has not gone as planned. Despite adding transitions to make it appear smooth, the drop-down menu just shows up instantly without any CSS effects taking place.
This is the code I have used:
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
visibility:hidden;
opacity:0;
position: absolute;
font-size:14px;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
text-align:left;
border-radius: 6px;
transition:0.5s;
}
.dropdown a{
color: black;
display:block;
padding:10px 0px 10px 0px;
text-decoration: none;
font-size:16px;
}
.dropdown:hover .dropdown-content {
display: block;
visibility:visible;
opacity:1;
}
<div class="dropdown">
<li><a href="#" class="eng-flag">EN</a></li>
<div class="dropdown-content" >
<a href="#" class="eng-flag">English</a>
<a href="#" class="gr-flag">Greek</a>
</div>
</div>