Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap 4 remove caret from dropdown button

In Bootstrap 3 you could easily remove the "caret" (small arrow that points down) from a dropdown button, I can't see how to do it in Bootstrap 4 though because they no longer use <span class="caret"></span>.

<div class="input-group mb-3">   <div class="input-group-prepend">     <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button>     <div class="dropdown-menu">       <a class="dropdown-item" href="#">Action</a>       <a class="dropdown-item" href="#">Another action</a>       <a class="dropdown-item" href="#">Something else here</a>       <div role="separator" class="dropdown-divider"></div>       <a class="dropdown-item" href="#">Separated link</a>     </div>   </div>   <input type="text" class="form-control" aria-label="Text input with dropdown button"> </div> 
like image 553
random_user_0891 Avatar asked Jan 09 '18 20:01

random_user_0891


People also ask

How do I remove a dropdown caret 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'.

How do I remove the drop down toggle icon?

In Bootstrap 4, you can remove the dropdown arrow which is called caret by declaring a $enable-caret SASS variable and setting it to false : $enable-caret: false; This overrides the default value of true set in the Bootstrap's _variable.

How do I get rid of the dropdown arrow in react?

You can hide the dropdown arrow from the DropDownButton by adding class e-caret-hide to DropDownButton element using cssClass property.

How can create hover dropdown in Bootstrap?

Answer: Use the jQuery hover() method By default, to open or display the dropdown menu in Bootstrap you have to click on the trigger element. However, if you want to show the dropdown on mouseover instead of click you can do it with little customization using the CSS and jQuery.


2 Answers

Simply remove the dropdown-toggle!

Here is an example: https://jsfiddle.net/ydnosrLw/

like image 110
Achmed Zuzali Avatar answered Sep 28 '22 03:09

Achmed Zuzali


It's done in css. Do something like that:

.dropdown-toggle:after { content: none } 
like image 23
Alexandre Annic Avatar answered Sep 28 '22 03:09

Alexandre Annic