rrrankin pro asked 7 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 7 years ago


thank you!

Marta Wierzbicka staff answered 7 years ago


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

ak.leimrey pro commented 6 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.

FREE CONSULTATION

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

Status

Specification of the issue

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