-
zahidvs14Asked 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
-
John JotForm SupportReplied 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.
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.
-
zahidvs14Replied on April 27, 2025 at 2:54 AM
color of selected item only.
-
Aries JotForm SupportReplied 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:
Give it a try and let us know how it goes.
-
zahidvs14Replied on April 28, 2025 at 2:41 AM
text should be white when it is selected
-
zahidvs14Replied on April 28, 2025 at 3:02 AM
I also want to change input text font size
-
John JotForm SupportReplied 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:
Give it a try and let us know if you need any more help.
-
zahidvs14Replied on April 28, 2025 at 5:53 AM
-
John JotForm SupportReplied 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.
-
zahidvs14Replied on April 28, 2025 at 8:20 AM
-
Jan JotForm SupportReplied 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.
-
zahidvs14Replied on May 12, 2025 at 10:23 AMText should be become white when they select
... -
Jan JotForm SupportReplied on May 12, 2025 at 10:59 AM
Your Answer
Something Went Wrong
An error occurred while generating the AI response. Please try again!