Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing focus border outline on bootstrap select

I am using this plugin in my project, and trying to remove the blue border on focuse on the select. I have tried by setting the outline to none, like this:

*:focus {
  outline: 0!important;
}

I have also tried with outline:none , but it is not working, how can I remove the outline from it?

I am using the same html as suggested in the plugin docs:

<select name="position" value="{{ $player->position or  old('position') }}" class="selectpicker show-menu-arrow form-control" multiple data-max-options="3" data-icon-base="ion" data-tick-icon="ion-checkmark-round" title="Choose positions (max 3)" required>
     @foreach($positions as $key => $value)
        <option data-subtext="{{ $key }}">{{ $value }}</option>
     @endforeach
</select>
like image 579
Ludwig Avatar asked Nov 26 '16 11:11

Ludwig


People also ask

How do I remove a blue outline in bootstrap?

If you're using Bootstrap 4, add box-shadow: none (and don't forgot the prefix -webkit-box-shadow: none ) to this answer. Also note that Bootstrap 4 already has . btn:focus { outline: none } in its btn classes.

How do I get rid of focus on buttons on click?

To remove focus around the button outline:none property is used. Outline property: Outline is an element property which draws a line around element but outside the border. It does not take space from the width of an element like border.

How do I turn off focus outline?

Using the CSS rule :focus { outline: none; } to remove an outline on an object causes the link or control to be focusable, but removes any visible indication of focus for keyboard users. Methods to remove it such as onfocus="blur()" result in keyboard users being unable to interact with the link or control.

How do I remove a bootstrap outline?

How to change this issue with the help of CSS or Bootstrap? The solution is adding “outline: none;” to the selector.


1 Answers

I fixed it with this:

.bootstrap-select .btn:focus {
    outline: none !important;
}

and you should add it at the end of your css code after the bootstrap-select.css

like image 159
Chiller Avatar answered Nov 24 '22 20:11

Chiller