I have a bootstrap default dropdown on my website. The issue I am having is that I want the dropdown to show up on hover. It is working as intended but has a small issue. It goes away unless I go on it through the dropdown arrow if I go on it from anywhere beside the arrow but directly below the dropdown item.. it goes away so it is very inconsistent. How can I make it better? I have tried adding padding to the dropdown item but it didn't help at all.
HTML:
<nav class="navbar navbar-inverse" role="navigation">
<div class="collapse navbar-collapse text-right">
<ul class="nav navbar-nav pull-left">
<li>
<div class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Testing</a>
<ul class="dropdown-menu dropdown-menu-arrow">
<li><a href="#">Testing</a></li>
<li><a href="#">Testing</a></li>
</ul>
</div>
</li>
</ul>
</div>
</nav>
CSS:
a {
color: #fff
}
a:focus,
a:hover {
color: #fff!important;
border-bottom: 1px solid #fff;
text-decoration: none
}
@media (min-width:768px) {
.dropdown:hover .dropdown-menu {
display: block;
}
.dropdown-menu-arrow:before {
border-bottom: 7px solid rgba(0, 0, 0, 0.2);
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
display: inline-block;
left: 9px;
position: absolute;
top: -7px;
}
.dropdown-menu-arrow::after {
border-bottom: 6px solid #FFFFFF;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
content: "";
display: inline-block;
left: 10px;
position: absolute;
top: -6px;
}
}