Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove bootstrap dropdown container?

the issue

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>
like image 969
Suhail Prasathong Avatar asked Apr 20 '16 23:04

Suhail Prasathong


People also ask

How do I remove a dropdown from Bootstrap?

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.

How do I get rid of the dropdown arrow?

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.

How do I stop dropdown menu Close menu items on clicking inside?

Removing the data attribute data-toggle="dropdown" and implementing the open/close of the dropdown can be a solution. Save this answer.

How do I toggle a drop down menu?

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.


1 Answers

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... */
}
like image 157
Sian Finlay Avatar answered Oct 19 '22 05:10

Sian Finlay