Я немного растерялся, как анимировать выпадающее меню только с помощью CSS.Не могли бы вы, ребята, зажечь меня здесь?
Я пытался
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-ms-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
, но я не могу нажать на заметку, где, как именно это сделать.Подменю отображается, но мгновенно без каких-либо переходов.Любая помощь будет отличной.
.dropbtn {
background-color: inherit;
color: inherit;
padding: inherit;
font-size: inherit;
}
.dropdown {
position: relative;
display: inline-block;
font-size: inherit;
}
.dropdown-content {
display: none;
position: absolute;
background-color: white;
min-width: 150px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
-webkit-transition: all 0.3s ease;
-moz-transition: all 0.3s ease;
-ms-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
height: 100px;
}
.dropdown-content a {
color: black;
padding: 12px 12px;
text-decoration: none;
display: block;
background-color: white;
}
.dropdown:hover .dropdown-content {
display: block;
height: 200px;
}
<ul>
<li class="dropdown">
<a href="javascript:" class="dropbtn">Dropdown</a>
<div class="dropdown-content">
<a href="#">Menu 1</a>
<a href="#">Menu 2</a>
<a href="#">Menu 3</a>
</div>
</li>
</ul>