Button Radios widget: How to Change the Background Color of the Options

  • zahidvs14
    Asked on April 27, 2025 at 12:32 AM

    change background color of line radio boxes like this in my form

    https://form.jotform.com/251092023419045


    Button Radios widget: How to Change the Background Color of the Options Image 1 Screenshot 20

  • John JotForm Support
    Replied on April 27, 2025 at 2:42 AM

    Hi Zahid,

    Thanks for reaching out to Jotform Support. You can easily add a red background color to one of the options by Injecting CSS Codes into the Button Radios widget. Let me walk you through it:

    1. First, copy the code below. This works for the Yes option. If you want to apply the red background to the No option, just change the number inside the parentheses from 1 to 2.

    /*thread 26517951*/
    div:nth-child(1) > label > span {
       background: red;
    }
    /*ends here*/

    2. In Form Builder, click on the Button Radios widget to select it.

    3. Next, click on the wand icon to open the widget's settings.

    Button Radios widget: How to Change the Background Color of the Options Image 1 Screenshot 30

    4. Click on the Custom CSS tab, then paste the code you just copied to the CSS code box.

    5. Click on Update at the bottom of the page, and you're done.

    Button Radios widget: How to Change the Background Color of the Options Image 2 Screenshot 41 Give it a try and let us know how it goes.

  • zahidvs14
    Replied on April 27, 2025 at 2:54 AM

    color of selected item only.

  • Aries JotForm Support
    Replied on April 27, 2025 at 3:31 AM

    Hi Zahid,

    If you want to change the background color of the selected option, remove the current custom CSS codes in the widget CSS code text field and inject the custom CSS codes below, and follow the same step my colleague John provided previously:

    input[type="radio"]:checked + label span {
      background-color: red;
    }

    Here's the result:

    Button Radios widget: How to Change the Background Color of the Options Image 1 Screenshot 20

    Give it a try and let us know how it goes.

  • zahidvs14
    Replied on April 28, 2025 at 2:41 AM

    text should be white when it is selected

  • zahidvs14
    Replied on April 28, 2025 at 3:02 AM

    I also want to change input text font size

  • John JotForm Support
    Replied on April 28, 2025 at 5:24 AM

    Hi Zahid,

    You can easily change the label color to white when selected and make the text larger by modifying the code provided by my colleague. Simply copy the updated code below and add it to the widget:

    input[type="radio"]:checked + label span {
        background-color: red;
        color: #ffffff;
        font-size: 16px;
    }
    input[type="radio"] + label span{
         font-size: 16px;
    }

    This will be the result:

    Button Radios widget: How to Change the Background Color of the Options Image 1 Screenshot 20

    Give it a try and let us know if you need any more help.

  • zahidvs14
    Replied on April 28, 2025 at 5:53 AM


    how to change font size of "enter your address?"Button Radios widget: How to Change the Background Color of the Options Image 1 Screenshot 20 Screenshot 10
  • John JotForm Support
    Replied on April 28, 2025 at 6:28 AM

    Hi Zahid,

    To avoid confusion, I moved your other question to a new thread and helped you with that here.

    Let us know if there’s anything else we can help you with.

  • zahidvs14
    Replied on April 28, 2025 at 8:20 AM

    I want to change hight of optons boxes in line radio boxes also remove blue arrow in options
  • Jan JotForm Support
    Replied on April 28, 2025 at 9:38 AM

    Hi Zahid,

    Just to keep things clear, I moved your other question to a new thread.

    Reach out again if you need any other help.

  • zahidvs14
    Replied on May 12, 2025 at 10:23 AM
    Text should be become white when they select
    ...
  • Jan JotForm Support
    Replied on May 12, 2025 at 10:59 AM

    Hi Zahid,

    I checked your form, and I can see that the Texts are white when it is selected.

    Button Radios widget: How to Change the Background Color of the Options Image 1 Screenshot 20

    Can you take a screenshot of what’s happening and send it to us? We’ve got a guide here that’ll show you how to do that.

    Once we hear back from you, we'll be able to help you with this.

Your Answer