How to center image radio buttons in form?

  • art_crate
    Asked on January 14, 2017 at 3:34 AM

    Hello,

     

    I would like to center my questions on mobile. Please see the screenshot attached.

     

    Questions that need to be centered:

    2,3,4,7,8,9,10

     

     

    Thanks!

    Jotform Thread 1034431 Screenshot
  • Nik_C
    Replied on January 14, 2017 at 2:55 PM

    I noticed that those fields were a bit off even in norma view, so please try to copy and paste the below CSS to your Custom CSS field:

    #cid_140{

    margin-left:25px!important;

    }

    #cid_128{

    margin-left:25px!important;

    }

    #cid_63{

    margin-left:25px!important;

    }

    #cid_157{

    margin-left:25px!important;

    }

    #cid_159{

    margin-left:25px!important;

    }

    #cid_112{

    margin-left:77px!important;

    }

    #cid_113{

    margin-left:77px!important;

    }

    You can adjust the margins more if needed.

    If you have any additional questions please let us know.

    Thank you!

  • art_crate
    Replied on January 16, 2017 at 8:15 PM

    Hi Nik,

    Thank you for the css. That seemed to center the questions. However now some of the Questions and Buttons (Next, Back) look like are pushed off the screen.

    Any ideas why that would be happening? That should all be responsive.

     

    Thanks!

  • Elton Support Team Lead
    Replied on January 16, 2017 at 11:20 PM

    Do you mean to say it creates horizontal spacing when viewed on mobile?

    On my colleague's CSS codes, replace margin with padding, see if this helps.

    Example:

    From:

    #cid_140{

    margin-left:25px !important;

    }

    To:

    #cid_140{

    padding-left:25px !important;

    }

    This should not expand the form width when viewed on mobile.

    Hope this helps!

  • art_crate
    Replied on January 18, 2017 at 3:01 AM

    Thank Elton,


    Changing to padding fixes the issues on mobile, but it breaks desktop view. Below you will find two screenshots to see the errors I was encountering:

    Padding

    Margin

     

    Thanks for the help!

  • Nik_C
    Replied on January 18, 2017 at 4:04 AM

    Please allow me some time to check this for you and I'll get back to you with possible solution.

    Thank you!

  • Nik_C
    Replied on January 18, 2017 at 11:25 AM

    Thank you for your patience.

    I did some tests, and with my original CSS code from the previous reply, I couldn't see what is wrong in the form.

    This is my test in Browser:

    How to center image radio buttons in form? Image 1 Screenshot 70

    And here are the screenshots from my phone:

    How to center image radio buttons in form? Image 2 Screenshot 81  How to center image radio buttons in form? Image 3 Screenshot 92

    How to center image radio buttons in form? Image 4 Screenshot 103 How to center image radio buttons in form? Image 5 Screenshot 114

    How to center image radio buttons in form? Image 6 Screenshot 125

    I'm sorry if I'm overlooking something, but it seems ok on my phone and my browser. Unless your buttons should be upper a bit.

    We'll wait for your response.

    Thank you!