JSFiddle - React, Tailwind, and code Playground
HTML
<div class="dropdown">
<a href="www.google.com">
some text
</a>
<div class="dropdown-content">
<p style="color: rgb(120, 120, 120);">
more text
</p>
</div>
</div>
CSS
@keyframes fade {
from {
opacity: 0;
visibility: hidden;
transform: translateY(10px);
}
to {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
}
.dropdown {
position: absolute;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
top: 40px;
background-color: #f9f9f9;
min-width: 330px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
animation: fade 1s ease forwards;
animation-delay: 2s;
}
.dropdown:hover .dropdown-content {
display: block;
margin-top: 0;
}