I need to create a menu that works this way: when you hover over a menu item, a list appears at the bottom of menu item. When I move the mouse to another element, the list smoothly slides to that element and changes items inside.
.wrapper {
position: relative;
}
.menu {
list-style: none;
display: grid;
grid-template-columns: repeat(3, min-content);
column-gap: 30px;
cursor: pointer;
}
.content {
position: absolute;
border: 1px solid grey;
}
.content-item {
padding: 10px 12px;
cursor: pointer;
}
<div class="wrapper">
<ul class="menu">
<li class="menu-item">Item1</li>
<li class="menu-item">Item2</li>
<li class="menu-item">Item3</li>
</ul>
<div class="content">
<div class="content-item">thing1</div>
<div class="content-item">thing1</div>
<div class="content-item">thing1</div>
</div>
</div>
2
Answers
You can use
opacity: 0
andvisibility: hidden
css property to make that effect when hovered onli
I have added the opacity and visibility CSS properties, and I’ve made some changes to the markup. Check the example below for better understanding.