As described in the image, I am attempting to get rid of the transparent container around the dropdown options. I've attempted multiple CSS solutions that have not worked. Here is the HTML code for the dropdown:
$('.navbar .dropdown').hover(function() {
$(this).find('.dropdown-menu').first().stop(true, true).slideDown(250);
}, function() {
$(this).find('.dropdown-menu').first().stop(true, true).slideUp(105)
});
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Home</a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#home" class="page-scroll">Home</a></li>
<li><a href="#about-section" class="page-scroll">About</a></li>
<li><a href="#services-section" class="page-scroll">Services</a></li>
<li><a href="#contact-section" class="page-scroll">Contact</a></li>
</ul>
</div>
Every Bootstrap dropdown button or link has an ::after selector in CSS. ::after selector is often used to insert some text after the content of the element. In this case, the content is a dropdown arrow. To remove it, just make the content go 'none'. One can use this feature to create navigation menus in top navbars.
The dropdown arrow icon in <select> input can be hidden by setting the CSS appearance: none. The CSS appearance property allows to suppress the native appearance of an element (which may vary with operating system), so that CSS can be used to restyle it.
Removing the data attribute data-toggle="dropdown" and implementing the open/close of the dropdown can be a solution. Save this answer.
To open the dropdown menu, use a button or a link with a class of . dropdown-toggle and the data-toggle="dropdown" attribute. The . caret class creates a caret arrow icon (), which indicates that the button is a dropdown.
So is it the container's shadow you don't want? If so you can alter the .dropdown-menu
class css by adding something like
.dropdown-menu {
border: none;
border-radius: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
If this doesn't work add !important
before the ;
on the properties that aren't disappearing, like so:
.dropdown-menu {
border: none !important;
/* etc... */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With