rrrankin pro asked 6 years ago

The default color for a switch in the 'On" state is purple. I can set <span class="lever red"></span> to change the lever to red, but how do I change the active button color to something besides the default purple?

rrrankin pro answered 6 years ago

thank you!

Marta Wierzbicka staff answered 6 years ago

add this code to your CSS file:
.switch label input[type=checkbox]:checked+.lever:after {
            background-color: red;

ak.leimrey pro commented 5 years ago

This changes the button itself, but not the underlying grey area. Is there any way to change the background in the same manner? Also, I feel you should have added such less obvious options in the documentation.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.


Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No