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

  • Profile Image
    betwrestling
    Asked on March 22, 2017 at 09: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?

  • Profile Image
    Boris
    Answered on March 22, 2017 at 01: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:

    Please let us know should you need further assistance.

  • Profile Image
    betwrestling
    Answered on March 22, 2017 at 03: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?

  • Profile Image
    Kevin_G
    Answered on March 22, 2017 at 07: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: 

    Hope this helps. 

  • Profile Image
    betwrestling
    Answered 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 :-)

  • Profile Image
    Ian
    Answered on March 23, 2017 at 02:23 AM

    Here is the code :

    ul#tabs-list {

        margin-bottom: -15px!important;

    }

     

    .form-pagebreak {

        margin-top: -8px!important;

    }

  • Profile Image
    betwrestling
    Answered on March 23, 2017 at 03: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?

  • Profile Image
    Ian
    Answered on March 23, 2017 at 04:14 AM

    The following code should do the trick 

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