would you people be able to help me out with a transition delay on mouse out? :D
My navbar has a dropdown-menu, but because there is a whitespace of several pixels between the main menu item and the submenu, on a mouse out the submenu disappears again if I don't move my mouse down quickly enough. I have been playing around with transition effects based on answers on other threads, but I just can't get it to work (because I do not really understand the logic - I usually learn through trial and error).
As such, would you people be able to help me out? I prefer a solution that focusses on transitions (instead of one that decreases the white-space), as I want to learn the transition skill for other web-design aspects as well. Hopefully, with that, I also understand better how these HTML structures actually work, so I can I re-use the basic concept for ideas.
NB: the menu-items change color upon hovering. The main CSS for that purpose is listed but I omitted the specific CSS for colors.
nav {
display:flex;
align-items:center;
flex-direction:row;
float:right;
nav-right:auto;
justify-content:space-between;
}
.btn.btn-primary {
border: 0px;
border-radius:0 !important;
-webkit-border-radius:0 !important;
}
.btn.btn-primary:hover {
}
.dropdown-menu {
border-radius:0 !important;
-webkit-border-radius:0 !important;
}
.dropdown ul.dropdown-menu li a{
border-radius:0 !important;
-webkit-border-radius:0 !important;
}
.dropdown ul.dropdown-menu li a:hover{
}
.dropdown:hover .dropdown-menu {
display: block;
}
<section>
<header class="container">
<div class="row">
<nav class="navbar navbar-default navbar-fixed-top" style="background-color:snow;">
<h2 class="col-md">
<a class="nav" href="./index">Foundation</a>
</h2>
<nav class="navbar-right">
<!-- make it into one block, or aligned block-->
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">
Our mission </button>
<ul class="dropdown-menu">
<li>
<a href="./Guidelines#Conservation">Natural resources</a>
</li>
<li>
<a href="./Guidelines#Food">Access to food</a>
</li>
<li>
<a href="./Guidelines#Health">Public health</a>
</li>
</ul>
</div>
</nav>
</nav>
</div>
</header>
</section>