How can I remove the arrow from drop down list in

2020-05-23 09:21发布

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?

9条回答
我欲成王,谁敢阻挡
2楼-- · 2020-05-23 09:25

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.

查看更多
等我变得足够好
3楼-- · 2020-05-23 09:27

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

查看更多
4楼-- · 2020-05-23 09:30

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>
查看更多
霸刀☆藐视天下
5楼-- · 2020-05-23 09:35

add .dropdown-toggle-split class in the tag

查看更多
闹够了就滚
6楼-- · 2020-05-23 09:38

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.

查看更多
相关推荐>>
7楼-- · 2020-05-23 09:47

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.

查看更多
登录 后发表回答