What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.
At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.
We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.
How to make radio items match width of their labelsAsked by MeetingHabits on December 27, 2016 at 11:04 AM
I searched the form and tried the CSS editor for a while with no luck. How can i make the width of my radio-items auto-adjust to match the size of the label. See attached.
Thanks a ton!
Please inject the following custom css code in form and see if that solves your problem:
width: 120px !important;
The following guide should help you how to inject custom css code in form: https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes
The output of the above css is:
Hope this helps.
Do get back to us if you have any questions.
Hi Ashwin, Thanks for the quick answer. Unfortunately, that doesn't work (it then screws up other fields (image below).
Is there any way to make the widths auto-adjust to the text?
If not, is there code I can use to set sizes for individual items?
Apart from what my colleague suggested, there is one more way to achieve this.
As it appears to me that you are not looking for fix width of the radio fields so you can also opt to paste the following code in the INJECT CSS section :
This should affect all the radio fields on the form.
Let us know if you have more questions.
Thanks for chiming in!!! I've injected the CSS. It looks great in the Advanced CSS editor preview but that doesn't carry over to the live form. Any ideas?
P.s. I opened in a new browser so it shouldn'd be the browser cache.
Please try with an !important statement.
width: auto !important;
Thanks, Mike. That did the trick. You guys rock!