How to align the headers to center

  • ilan_ilan190
    Asked on March 27, 2024 at 7:32 AM
    In addition I am unable to center the form header title even though I did target its CSS class to - text-align: center;
  • Richie JotForm Support
    Replied on March 27, 2024 at 7:36 AM

    Hi ilan_ilan190,

    Thanks for reaching out to Jotform Support. You can move the header using CSS code. Please replace your CSS code with the new one. Let me show you how:

    1. In Form Builder and click on the Paint Roller icon on the right corner of the screen.
    2. Go to the Styles tab and scroll down.
    3. Paste the code below into the Inject Custom CSS field.
    div.form-header-group.header-large{
        margin-right: 16%;
    }

    How to align the headers to center Image 1 Screenshot 30

    Check out this screenshot of my result:

    How to align the headers to center Image 2 Screenshot 41

    Give it a try and let us know if this works for you.

  • ilan_ilan190
    Replied on March 27, 2024 at 7:50 AM

    Thank you for the replay.

    not a very good solution as you can see the underline has moved as well, and it is not centered correctly.

    please find what is preventing it from being controlled properly. because the text alignment button in the properties section does not have any affect so it is fine to solve it with CSS but please give me a better more professional solution

  • Richie JotForm Support
    Replied on March 27, 2024 at 8:10 AM

    Hi ilan_ilan190,

    Thanks for trying out my work around. It seems I did not target the correct field ID that is why the underline was affected. You can try this CSS instead:

    #header_1{
       text-align: center;
    }

    Check out this screenshot of my result:

    How to align the headers to center Image 1 Screenshot 20

    Give it a try and let us know if this works for you.

  • ilan_ilan190
    Replied on March 27, 2024 at 8:54 AM

    thank you very much, I didn't target the correct one as well

    I appreciate the effort