I want to decrease space on my form but only on mobile devices

  • betwrestling
    Asked on March 22, 2017 at 9:20 AM

    I would like to decrease the space between radio buttons on my form but ONLY on mobile devices. Please see screenshot to see which spaces i am referring to that i want decreased.

    How can this be achieved?

  • Boris
    Replied on March 22, 2017 at 1:16 PM

    I'm afraid there wasn't any screenshot attached to your post:

    https://www.jotform.com/answers/1098632

    To decrease the vertical space between different Radio Button fields, and do this only on mobile devices, please inject the following custom CSS into your form:

    @media only screen and (max-width: 640px) {
      li[data-type="control_radio"] {
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 1%;
        padding-bottom: 1%;
      }
    }

    You can add CSS to your form by following this guide:

    https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    The form will end up looking similar to the following screenshot:

    I want to decrease space on my form but only on mobile devices Image 1 Screenshot 20

    Please let us know should you need further assistance.

  • betwrestling
    Replied on March 22, 2017 at 3:05 PM

    That's great thank you!

    Also, how would i decrease the space between all other elements of the form on mobile devices only? (tabs, header, picture, etc).

    Is there a way to adjust spacing for ALL elements using one piece of code?

  • Kevin Support Team Lead
    Replied on March 22, 2017 at 7:21 PM

    To affect all the fields in your form you could inject this CSS code: 

    @media screen and (min-width: 480px){

        .form-line, .form-input-wide, #tabs-list{

            margin-top: 0;

            margin-bottom: 0;

            padding-top: 0;

            padding-bottom: 0;

        }

    }

    This should be the result: 

    I want to decrease space on my form but only on mobile devices Image 1 Screenshot 20

    Hope this helps. 

  • betwrestling
    Replied on March 22, 2017 at 10:08 PM

    Thank you! Just two more things..how do i increase the space between the tabs and main header (e.g 'Goldberg (c) Vs. Brock Lesnar') and also how do i increase the space between the bottom radio options and the page break? Thanks again :-)

  • Ian
    Replied on March 23, 2017 at 2:23 AM

    Here is the code :

    ul#tabs-list {

        margin-bottom: -15px!important;

    }

     

    .form-pagebreak {

        margin-top: -8px!important;

    }

  • betwrestling
    Replied on March 23, 2017 at 3:58 AM

    Thanks so much!

    One FINAL question then i promise to quit annoying you!

    What is the code to increase the space between the top of the form and the tabs?

  • Ian
    Replied on March 23, 2017 at 4:14 AM

    The following code should do the trick 

    ul#tabs-list {
    margin-top: 15px;
    }