12

I am trying to remove the arrow that appears on a drop down menu in Twitter Bootstrap framework. Has anyone figured a way of removing the arrows?

rmtheis
  • 5,992
  • 12
  • 61
  • 78
Gandalf
  • 1
  • 29
  • 94
  • 165
  • 4
    I removed and the arrow is gone,that solved it. – Gandalf Apr 20 '12 at 10:56
  • If you found your answer before it was posted, post it as an answer below and approve it to close this thread, that way it can help future users as well. – Andres I Perez Apr 20 '12 at 11:35
  • @Andres,the think with memebers with less than 100 reps. they cant answer their own question before 8 hours are over.I have accepted an answer,thanks for the pointer. – Gandalf Apr 20 '12 at 14:08

9 Answers9

26

Removing the caret class from the link removes the arrow from the navigation bar,

.dropdown-menu::before, 
.dropdown-menu::after {
    border: none;
    content: none;
}

Will remove the little tab from the drop down menu its self.

Adam Patterson
  • 651
  • 5
  • 11
  • 2
    I was force to add the `!important` flag to override the bootstrap settings. There's quite a few layers of specificity on the original declaration. – Lotus Mar 08 '13 at 18:15
  • You are not forced to add `!important`. Just make your rules more specific than the bootstrap ones. – A1rPun Jul 10 '19 at 14:24
22

From: https://getbootstrap.com/2.3.2/components.html#buttonDropdowns

<div class="btn-group">
  <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
    Action
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
    <!-- dropdown menu links -->
  </ul>
</div>

If you remove <span class="caret"></span> the arrow is not shown.

Tried it using the dev. console in Chrome, and seems to work.

chb
  • 1,727
  • 7
  • 25
  • 47
Lasse Christiansen
  • 10,205
  • 7
  • 50
  • 79
  • @TahirAlvi Done. In the future, feel free to update links without notifying the author. – chb May 07 '19 at 04:35
4

If you copy an existing Bootstrap dropdown example, the menu button tag looks something like this:

<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Menu Name</button>

Removing the dropdown-toggle class removes the arrow (or caret):

<button class="btn btn-primary" type="button" data-toggle="dropdown">Menu Name</button>
Happy Hippo
  • 102
  • 9
3
.dropdown-toggle::after{
    display: none;
}
Dina Fouda
  • 41
  • 3
2

Just remove border-bottom from dropdown-menu will remove arrow from the navigation bar.

.navbar .nav > li > .dropdown-menu:before, .navbar .nav > li > .dropdown-menu:after{
    border-bottom: none;
}
Suhaib Janjua
  • 3,538
  • 16
  • 59
  • 73
1

I've found the best solution is to add overflow:hidden; to .dropdown-menu

Nicole Harris
  • 850
  • 1
  • 13
  • 24
  • I used this solution to prevent the caret from showing up in a side menu when the menu was collapsed against the side of the screen. +1 for a simple solution. – Caveman Jun 14 '16 at 20:14
-1

add .dropdown-toggle-split class in the tag

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
-1

The only thing that worked for me was that I removed class="caret" if you are using bootstrap dropdown. Hope this work for you too.

m00am
  • 5,910
  • 11
  • 53
  • 69
-1

In Bootstrap4 remove "dropdown-toggle" class from "a" element.

Aagii
  • 43
  • 1
  • 5