CSS: Display email and phone fields on the same line?

  • henryclarke10
    Asked on September 6, 2024 at 12:35 PM

    On my form https://form.jotform.com/242484485546164 I'm trying to get the email and phone fields on the same line to save vertical space. I set them both to Shrink in Advanced settings and it shrunk them but didn't move them to the same line.

    Jotform Thread 18747891 Screenshot
  • Camila JotForm Support
    Replied on September 6, 2024 at 1:24 PM

    Hi Steve,

    Thanks for reaching out to Jotform Support. To get the email and phone fields on the same line, we need to use CSS code to achieve it. Let me show you how to do it:

    1. First, copy this code:

    li#id_11 {
        margin-top: -86px !important;
        margin-left: 196px !important;
    }

    2. In Form Builder, click on the Paint Roller icon on the right side of the page to open Form Designer.
    CSS: Display email and phone fields on the same line? Image 1 Screenshot 50

    3. Now, in the Form Designer menu, click on the Styles tab.

    CSS: Display email and phone fields on the same line? Image 2 Screenshot 61

    4. Scroll down, and paste the copied code into the Inject CSS Code box. The code will be saved automatically. That's it.

    CSS: Display email and phone fields on the same line? Image 3 Screenshot 72

    Check out the result:

    CSS: Display email and phone fields on the same line? Image 4 Screenshot 83

    You can check out this Demo Form so you can try it by yourself. If you want to clone the form, you can check out this guide about How to Clone an Existing Form From a URL.

    You can also check this guide How to Inject Custom CSS Codes.

    Let us know if there’s anything else we can help you with. 

  • henryclarke10
    Replied on September 6, 2024 at 1:58 PM

    Thanks very much!

Your Answer