3

I'm using Bootstrap Vue plugin - https://bootstrap-vue.js.org/

I need to change dropdown menu default background when someone select value from dropdown like this.

enter image description here

enter image description here

But this is the problem. When someone click dropdown, They toggle "show" class in dropwdown wrapper. No any class new class for red color highlighted div.

enter image description here

I tried to style .dropdown-toggle class but it overrides default style only. Any solution?

.dropdown-toggle{
  background-color: #FF5722;
  border-color: #FF5722;
}

Jsfiddle

5
  • try setting the style for button instead of .dropdown-toggle Commented Feb 9, 2018 at 6:08
  • No luck, Same result Commented Feb 9, 2018 at 6:10
  • .show>.btn-secondary.dropdown-toggle {background-color: #FF5722} make sure your custom css is loaded after the buttons.scss file style Commented Feb 9, 2018 at 6:14
  • When someone click and select value, .show class removes from div. Then this is\n working. Commented Feb 9, 2018 at 6:16
  • Your Fiddle => jsfiddle.net/o2gqmqzy/1 Commented Feb 9, 2018 at 12:50

2 Answers 2

0

You can do it directly in style. ex:

  <b-form-select
  options="[1, 2, 3]"
  style="background: red">
</b-form-select>

or create a class...

Sign up to request clarification or add additional context in comments.

Comments

-6
  <button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
      <span class="sr-only">Toggle Dropleft</span>

In the place of btn btn-secondary change button classes like danger,primary, etc.... for more information follow this link

https://getbootstrap.com/docs/4.0/components/dropdowns/

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.