This question already has an answer here:
- Transitions on the display: property 31 answers
I'm trying to transition effect for my menu's dropdown, but unlike the other cases, I can't manage to get it work. I've search lots of theards around here and over google as well. I found no solution.
Here's my code:
.dropdown2 {
position: relative;
display: inline-block;
}
.dropdown-content2 {
display: none;
position: absolute;
background-color: #e1e1e1;
color: #000;
min-width: 150px;
height: 220px;
z-index: 999;
font-size: 20px;
margin-right: -10px;
top: 34px;
transition: height 2s;
}
.dropdown-content2 a {
padding: 12px 16px;
text-decoration: none;
display: block;
border-bottom: 5px solid white;
}
.dropdown2:hover .dropdown-content2 {
display: block;
}
.dropdown2:hover .dropbtn2 {
background-color: #e1e1e1;
}
HTML:
<div class="menu_option dropdown2"><a href="?go=articles">articles</a>
<div class="dropdown-content2">
<a href="?go=news">news</a>
<a href="?go=reviews">reviews</a>
<a href="?go=guides">guides</a>
<a href="?go=art">art</a>
</div>
</div>
And it doesn't work.