Changing the background and text color for selected item in the Button check boxes widget

  • criterions
    Asked on July 13, 2016 at 10:06 AM

    I would like to know the correct CSS to inject to control the background and text color for any selected item using the Button Checkboxes widget. Is this possible?

  • Jan
    Replied on July 13, 2016 at 12:41 PM

    Currently, the CSS being applied on the widget is this:

    .checkboxes input + label {
    color: #999999; /* text color */
    background: linear-gradient(to bottom, #fff 0%, #eee 100%); /* background color */
    }

    If you want to change it, then please use this CSS code:

    .checkboxes input + label {
    color: white; 
    background: blue; 
    }

    You need to insert this code inside the widget. Select the widget and then click the wizard icon.

    Changing the background and text color for selected item in the Button check boxes widget Image 1 Screenshot 30

    After that, go to the Custom CSS tab and paste the code.

    Changing the background and text color for selected item in the Button check boxes widget Image 2 Screenshot 41

    Hope that helps. Thank you.

  • criterions
    Replied on July 13, 2016 at 12:49 PM

    Ok, that's definitely very cool. But, what I want is to change the background and text color when it is checked. When it isn't checked, it should retain its default color. Is that possible?

  • Jan
    Replied on July 13, 2016 at 1:57 PM

    Yes, that is possible. Here's the CSS code:

    .checkboxes input.checkedButtonCheckbox + label {
    color: white;
    background: blue;
    }

    This code should be inserted inside the widget. Here's the result:

      Changing the background and text color for selected item in the Button check boxes widget Image 1 Screenshot 20

    If you have any questions, let us know. Thank you.

  • criterions
    Replied on July 13, 2016 at 1:58 PM

    PERFECT!!! Many thanks!

  • Jan
    Replied on July 13, 2016 at 2:02 PM

    You're welcome. Glad to hear that your happy with the support. Have a nice day!