How to Build Horizontal Forms with Gravity Forms (2024)

How to Build Horizontal Forms with Gravity Forms (1)Jordan Smith

/Updated January 22, 2024

How to Build Horizontal Forms with Gravity Forms (2)

May 19, 2022: Updated to support GF 2.5's layout editor, GF 2.6's inline submit button and using multi-input fields (like the Name field).

May 19, 2022: Updated to support GF 2.5's layout editor, GF 2.6's inline submit button and using multi-input fields (like the Name field).

By default, Gravity Forms outputs it’s forms in a vertical (or column) format. This just means that the form fields are stacked on top of one another all the way down the form. This is ideal for most forms but there are some cases where you may want to display your form with a horizontal layout instead. This means the form fields are displayed side by side, in a row, also allowing for an inline submit button.

Gravity Forms can actually get you a decent way towards this goal using the powerful Gravity Forms CSS Class and the drag and drop editor. This method of creating horizontal forms does have some limitations. Here’s an example using the helper styles we provide later in this tutorial.

How to create Gravity Forms with a Horizontal Layout

Step 1 – Align Fields Using Drag and Drop Editor

Go to whichever form you’d like to layout horizontally. Using the the Drag and Drop editor, align the fields in your form horizontally by dragging the fields into the Column Drop Zones.

To place the Submit button at the end of the form, first select it, then navigate to the Appearance tab. Set the Submit Button Location to End of the last row.

At this point your Gravity Form is now a horizontal form!

There are two additional steps we can take to make this even more streamlined.

Step 2 – Hide the Field Label and Sub Labels

In many cases when implementing a horizontal form, you are putting it in location without a ton of room. We can hide the labels and use placeholders to save a little space. Visit the Appearance tab on each field and set visibility to Hidden in the Field Label Visibility and Sub-Label Placement drop down fields.

After applying this configuration, your form should now look something like this:

Step 3 – Add Helper Styles

We’re inching closer to something good here… but you might notice that some of the fields aren’t properly aligned and the submit button is larger than the inputs. Here are some simple helper styles that can act as a starting point to get your horizontal form styled more consistently.

This code can be copied and pasted into your theme’s style.css stylesheet file. Keep in mind, theme styles are not loaded in preview so you might want to check out Gravity Forms Live Preview for an easy way to preview your forms directly in your WordPress theme.

.gw-horizontal-form_wrapper .ginput_container input,.gw-horizontal-form_wrapper .ginput_container select,.gw-horizontal-form_wrapper #field_submit input.button {height: 2.4rem;}.gw-horizontal-form_wrapper #field_submit input.button {padding: 0 1.4rem;}.gw-horizontal-form_wrapper .gform_fields {grid-column-gap: 1vw !important;}.gw-horizontal-form_wrapper .ginput_complex span:not(:first-child) {padding-left: 1vw !important;}

Step 4 – Add gw-horizontal-form to the Form’s CSS Class Name Setting

Now we need to apply those helper styles to our form. We’ll do this by setting the helper class on our form settings.

Visit the Form Settings for the form you want to convert and add the gw-horizontal-form class to the CSS Class Name setting.

After applying the helper class to your form, the final result will look something like this:

Limitations

  1. This method works best for simple forms with only a few fields.
  2. This method isn’t a “final” solution but it should get you exactly 93% of the way there.
  3. This method requires some additional customization to handle responsive styling e.g. for column layouts.

The pros are that it’s available with the Gravity Forms WordPress plugin out of the box and doesn’t require too much effort to get everything looking just right without using add-ons.

What questions do you still have?

Do you still have any questions about how to build horizontal forms with the Gravity Forms plugin in WordPress? We’d love to know what they are.

Did this resource help you do something awesome with Gravity Forms?

Then you'll absolutely love Gravity Perks; a suite of 47+ essential add-ons for Gravity Forms with support you can count on.

View All PerksBuy Now

Tags: css, gf_inline, gf_simple_horizontal, gp live preview, horizontal forms, styling

  1. How to Build Horizontal Forms with Gravity Forms (10)

    Jeffrey PhillipsMarch 15, 2022 at 6:49 pm

    I’m looking at the current Gravity Forms documentation on gf_simple_horizontal and see this: “This class is deprecated by the submit button being built directly into the Form Editor in Gravity Forms 2.6.” I was only able to get good results by setting a fixed width on the email field, otherwise it was short.

    Do you have any updated thoughts? Thanks!

    1. How to Build Horizontal Forms with Gravity Forms (11)

      Dario SpaceStaffMarch 15, 2022 at 6:54 pm

      Hi Jeffrey,

      It seems the Submit button on GF 2.6 it’s available in the Form Editor and lets you set the width of the button in the Appearance tab. I would suggest reaching out to Gravity Forms support about this question.

      Cheers.

    2. How to Build Horizontal Forms with Gravity Forms (13)

      Jeffrey PhillipsMarch 15, 2022 at 7:26 pm

      Even better: GF 2.6 does all of this in the form editor.

    3. How to Build Horizontal Forms with Gravity Forms (14)

      Dario SpaceStaffMarch 15, 2022 at 7:33 pm

      Thanks for the heads up Jeff, this looks slick!

  2. How to Build Horizontal Forms with Gravity Forms (15)

    Chris L-SApril 20, 2021 at 1:09 pm

    Hi –

    Any thoughts on how to make validation errors (like required field needs to be entered) not mess up the formatting of horizontal forms?

    Thanks!

  3. How to Build Horizontal Forms with Gravity Forms (17)

    Aimé JocelynJanuary 28, 2021 at 6:37 am

    Please some one to help me ? Sub-Label Placement not appear…How could I inlude it ?

    1. How to Build Horizontal Forms with Gravity Forms (18)

      Scott RyerStaffFebruary 17, 2021 at 10:47 am

      Hi Aimé,

      If you have a Gravity Perks license, drop us a line in Support and we’ll be happy to dig into this for you.

  4. How to Build Horizontal Forms with Gravity Forms (19)

    RuudMay 10, 2020 at 4:46 pm

    Applied one of the codes mentioned above and now at least the field and button are aligned and centered.

    (Green newsletter signup form at) https://www.alettahelena.com

    Now, I would like to have fields and button using the entire available space.

    Any suggestion would be honestly appreciated.

    Thanks in advance!

    1. How to Build Horizontal Forms with Gravity Forms (20)

      Ryan DonovanMay 11, 2020 at 9:57 am

      Hello Rudd, Thank you for writing in. I do see that your page has gf_simple_horizontal set for the form but I do not see gf_inline set for each inline item. Also, it looks like you may want to edit your CSS files to center the form as a whole. Here is a tutorial from Gravity Forms on how to do that.

  5. How to Build Horizontal Forms with Gravity Forms (21)

    StuartMarch 12, 2020 at 3:20 pm

    Hi,I’m getting some strange behaviour with this one. I apply the css classes as described. It then “hides” my email field label and reduces the size of the email field box.

    any thoughts on why that would be and how to rectify?

    Thanks,Stuart

    1. How to Build Horizontal Forms with Gravity Forms (22)

      JasonMarch 18, 2020 at 10:41 pm

      It’s not working for me either, maybe GF have changed something on the CSS side that is causing issues with this?

    2. How to Build Horizontal Forms with Gravity Forms (23)

      JasonMarch 18, 2020 at 10:58 pm

      Label placement must be Top aligned in form settings/form layout (step 1).

    3. How to Build Horizontal Forms with Gravity Forms (24)

      Ryan DonovanMarch 19, 2020 at 9:31 am

      Hey Jason, Excellent question. This seems to be a default interaction with gf_simple_horizontal. This only works with the “top label” form layout option. When added to “CSS Class Name” in your form settings will create a very simple horizontal form layout (think simple email address field and inline form button). The field label is hidden so using the placeholder option for the field is recommended. Please note that this works best on very simple, single-input field types. Also, it works best if you set the input size to “large” in the field settings. Let us know if you have any other questions.😀

  6. How to Build Horizontal Forms with Gravity Forms (25)

    Robert NorcrossDecember 26, 2019 at 4:16 pm

    Is it possible to do this for mobile? Obviously wouldn’t make sense with a lot of fields, but we have 1 field and a “send” button.

    1. How to Build Horizontal Forms with Gravity Forms (26)

      David SmithStaffJanuary 7, 2020 at 3:35 pm

      I would expect this to work in mobile now. Do you have an example of what you’ve implemented with this so far?

    1. How to Build Horizontal Forms with Gravity Forms (29)

      David SmithStaffNovember 16, 2019 at 7:58 pm

      Do you have a URL where I could view this form?

    2. How to Build Horizontal Forms with Gravity Forms (30)

      Scott RyerStaffNovember 20, 2019 at 10:40 am

      Hi Annette, thanks for reaching out to us via Gravity Perks support. I wanted to follow up here for the benefit of other folks having this issue.

      The difference in styling between Chrome and Firefox was due to some existing CSS in the site’s theme. If you run into this, you can simply add this to your theme’s style sheet to force the form to 100% width in both browsers:

      http://snippi.com/s/13yiw81

  7. How to Build Horizontal Forms with Gravity Forms (31)

    Andrew PetersSeptember 26, 2019 at 12:57 pm

    Is there a way to just make the submit button inline with the very last field?

    Like I want my whole form to be three lines. The first two lines would each have two questions, the last line would have one question then the Submit button.

    1. How to Build Horizontal Forms with Gravity Forms (32)

      David SmithStaffSeptember 26, 2019 at 3:59 pm

      This is possible with custom CSS but will differ per theme and form.

  8. How to Build Horizontal Forms with Gravity Forms (33)

    ChrisJuly 11, 2019 at 8:50 pm

    Thanks for this tutorial.

    I’m trying to add the form to a newsletter template that came with my theme. When I added the “gf_simple_horizontal” and “gf_inline” appropriately, the email field became smaller.

    Is there a way to increase the length of the email field (it’s in large already)?

    1. How to Build Horizontal Forms with Gravity Forms (34)

      David SmithStaffJuly 12, 2019 at 8:10 am

      Hi Chris, the form-level classes override some of the styles on the form elements. You would need to use CSS to set a desired width on your Email field.

  9. How to Build Horizontal Forms with Gravity Forms (35)

    ShmuelApril 4, 2019 at 5:37 pm

    How can I accomplish the same look for a multi-page form so that the next button would be in place of the submit button with same inline style?

    1. How to Build Horizontal Forms with Gravity Forms (36)

      David SmithStaffApril 4, 2019 at 9:52 pm

      We don’t have a solution for this one.

  10. How to Build Horizontal Forms with Gravity Forms (37)

    GaryMarch 17, 2019 at 7:03 pm

    Thank you. Works perfectly.

  11. How to Build Horizontal Forms with Gravity Forms (38)

    CavtecMarch 7, 2019 at 10:14 am

    What would be the CSS to centralize this?

    1. How to Build Horizontal Forms with Gravity Forms (39)

      David SmithStaffMarch 7, 2019 at 10:38 am

      Come again?

    2. How to Build Horizontal Forms with Gravity Forms (40)

      CavtecMarch 7, 2019 at 11:31 am

      Naturally the form appears to be aligned to the left. Is there a container or ready class to centralise this?

    3. How to Build Horizontal Forms with Gravity Forms (41)

      LawrenceMarch 10, 2019 at 8:37 pm

      I’m looking to do this too.

    4. How to Build Horizontal Forms with Gravity Forms (42)

      David SmithStaffMarch 11, 2019 at 8:10 am

      I think I’m still misunderstanding? The “gf_simple_horizontal_wrapper” is the class to use to centralize this behavior.

    5. How to Build Horizontal Forms with Gravity Forms (43)

      BrianApril 3, 2019 at 8:26 pm

      I’m having the same issue, I have have the gf_simple_horizontal set with gf_inline on all 3 input fields and the form is left justified left rather than center.

      https://termitetiger.com/test/

      I’m using Divi theme.

      Any clue why it is left rather than center justified?

    6. How to Build Horizontal Forms with Gravity Forms (44)

      David SmithStaffApril 3, 2019 at 9:19 pm

      Hi Brian, this is the default behavior of the gf_simple_horizontal ready class. You would need additional custom CSS to center it.

    7. How to Build Horizontal Forms with Gravity Forms (46)

      David SmithStaffNovember 7, 2019 at 2:45 pm

      Thanks for sharing, JaxRachel!

  12. How to Build Horizontal Forms with Gravity Forms (47)

    KOOctober 18, 2018 at 12:40 pm

    Fantastic Tip. Works perfectly. TY!

  13. How to Build Horizontal Forms with Gravity Forms (48)

    MarianneMarch 28, 2018 at 5:04 pm

    how do you change the size of the fields for horizontal forms? I want only an email field with a button. The field size never changes. I tried selecting “small”, “medium” and “large”

    1. How to Build Horizontal Forms with Gravity Forms (49)

      David SmithStaffApril 11, 2018 at 11:37 am

      Looks like Gravity Forms doesn’t support this in this context. You would need to use CSS to set the sizes manually.

  14. How to Build Horizontal Forms with Gravity Forms (50)

    edJanuary 30, 2018 at 4:48 am

    Do you have anything in your kit to add a modal box helper at the end of a field title for the person completing the form, much in the same way that the admin panel has them with the ‘?’ and when you hover additional explanation comes up. As some fields only display conditionally it needs to be in with the form title. I don’t want to swamp the form with extensive text in the description field that is offered. Thanks

  15. How To: Horizontal Forms – Pinnacle Pools & SpaJanuary 3, 2017 at 2:06 am

    […] Source: How to Build Horizontal Forms with Gravity Forms – Gravity Wiz […]

  16. Gravity Forms Felder horizontal anordnen › Tips und Tricks für WordPress, WordPress, WordPress PluginsDecember 5, 2016 at 4:01 am

    […] Jungs und Mädels von Gravitywiz empfehlen zusätzlich auch noch dem gesamten Formular die […]

  17. How to Build Horizontal Forms with Gravity Forms (52)

    Rachel R.November 23, 2016 at 6:53 pm

    Do you know if there’s a way to make only part of form horizontal?

    Two or three fields can be placed on the same line with the “thirds” or “halves” style options — but not the submit button. So I have, for instance, some HTML fields I want above, and then a name, address, and submit button below that I’d like to be in a line. I can get the name and address on the same line, but I can’t seem to control the placement of the submit button.

    (Also, your readers should be aware that under normal circ*mstances, hiding the field labels and relying on placeholder text alone is bad practice. Screen readers, etc. used for accessibility purposes won’t read the placeholder; they need the label.)

    1. How to Build Horizontal Forms with Gravity Forms (53)

      David SmithStaffNovember 23, 2016 at 8:52 pm

      Thanks, Rachel, I thought we had a mention in here about accessibility but it was actually on this other article.

      In regards to your question, I do not know of a ready solution for making only part of the form horizontal outside of the ready classes you already mentioned. You’d have to write some custom CSS to wrangle the submit button into it’s desired location.

    2. How to Build Horizontal Forms with Gravity Forms (54)

      Rachel R.November 23, 2016 at 9:04 pm

      Well, drat. I was hoping there might be an easy way. This CSS newbie is struggling with all the CSS wrangling to get a decent-looking form. .lol

      Thank you!

  18. How to Build Horizontal Forms with Gravity Forms (55)

    David QuinanillaOctober 18, 2016 at 1:14 am

    Line 17 is missing a :

    1. How to Build Horizontal Forms with Gravity Forms (56)

      David SmithStaffOctober 18, 2016 at 8:16 am

      Fixed. Thanks, David!

  19. How to Build Horizontal Forms with Gravity Forms (57)

    makiiAugust 13, 2016 at 12:39 pm

    Hi,I tried gf_simple_horizontal with just an email field. But the field does not resize–it stays at small whether I select large or medium.

    Any suggestions? Thx!

    1. How to Build Horizontal Forms with Gravity Forms (58)

      David SmithStaffAugust 14, 2016 at 7:45 am

      Hi Makil, the gf_simple_horizontal class overrides some of GF’s other styles, including the size setting. You can manually override the width for any input by adding a custom style to your theme’s stylesheet:

      input#input_1418_1 {width: 500px;}

      Where “1418” is your own form ID and the “1” is your field ID. Template: input#input_FORMID_FIELDID

  20. How to Build Horizontal Forms with Gravity Forms (59)

    faithbeginsJune 15, 2016 at 9:19 am

    I would like to Create 4 column table in Gravity form can you provide me the code

    Local Guardian (If Any):S.No Name Relationship Address (w/ tel. no.)

    Form & output should be like Table

    1. How to Build Horizontal Forms with Gravity Forms (60)

      David SmithStaffJune 30, 2016 at 9:18 am

      Sorry, Faith. We’re not able to provide bespoke code pro bono.

Comments are closed.

How to Build Horizontal Forms with Gravity Forms (2024)

FAQs

How to Build Horizontal Forms with Gravity Forms? ›

To create your first form, open the Forms menu and select New Form. To add a form field, simply click or drag the field you would like to add to your form. The Gravity Forms toolbox consists of an accordion interface that allows you to select which field types you would like to add.

How to create form using gravity form? ›

To create your first form, open the Forms menu and select New Form. To add a form field, simply click or drag the field you would like to add to your form. The Gravity Forms toolbox consists of an accordion interface that allows you to select which field types you would like to add.

How to create a horizontal form in WordPress? ›

How to Create Your Own Horizontal Contact Form Template for WordPress
  1. Choose from a list the Horizontal Contact Form template specifically for WordPress.
  2. Open the picked template.
  3. Hit the “Use Template” button.
  4. Customize all the elements and characteristics of the Horizontal Contact Form to match your WordPress design.

Is Gravity Forms worth it? ›

In general, Gravity Forms can make a great option for people who want to build more advanced types of forms on WordPress. By “advanced”, that could mean different form types such as payment forms, user registration forms, lead generation forms, and so on.

Is Gravity Forms free or paid? ›

However, a lot of people can benefit from the extra features that the Gravity Forms Basic license offers, even if you're just creating simple forms. For just $59 per year, you can access a lot of features to enhance your contact forms, as well as build more advanced types of forms.

How do you make a horizontal form? ›

Horizontal form

Create horizontal forms with the grid by adding the . row class to form groups and using the . col-*-* classes to specify the width of your labels and controls.

How do you align fields in gravity forms? ›

Using the the Drag and Drop editor, align the fields in your form horizontally by dragging the fields into the Column Drop Zones. To place the Submit button at the end of the form, first select it, then navigate to the Appearance tab. Set the Submit Button Location to End of the last row.

How do I create a dynamic form in WordPress? ›

To add a new dynamic form easily in your site, follow these steps:
  1. Log in to WordPress as the administrator.
  2. On the Dashboard in the left sidebar, click Plugins, and then click Add New:
  3. Search for “Ninja Forms” and click Install Now. ...
  4. On the Dashboard, in the left sidebar click Ninja Forms, and then click Add New:

How do you make Gravity Forms look good? ›

To style a Gravity Form, you need to apply some simple CSS to the elements of the form. There are several ways you can add custom CSS to your site but the easiest is to go to Appearance > Customize > Additional CSS and add the code there. The first thing you need to do is decide which elements you want to style.

Can you use Gravity Forms for free? ›

If you're ready to try out Gravity Forms yourself, you have two ways to get started: Purchase your Gravity Forms license today to start building on your own sites right away. Spin up a 100% free, fully functional demo site to try all of the Gravity Forms features and add-ons on a working WordPress site.

Does Gravity Form have an API? ›

Gravity Forms has an extensive developer API that can be used to access and extend default functionality. Following is a brief description of the different areas of Gravity Forms' API. Understanding the purpose of these different areas is important to make sure the right API is used.

Can Gravity Forms be used outside of WordPress? ›

I have a feeling I know the answer (will be no), but I was asked to ask, so I'm asking. :-) There isn't any way to use Gravity Forms without WordPress. Gravity Forms uses functions built-in to WordPress, and would require a great deal of work to separate out.

What does Gravity Wiz do? ›

Gravity Wiz is a Gravity Forms Certified Developer dedicated to providing helpful plugins, snippets, and tutorials for Gravity Forms. Gravity Wiz offers a suite of add-ons called “Gravity Perks” and each one adds a small enhancement to Gravity Forms.

How do you insert a form in Gravity Forms? ›

How To Add The Gravity Forms Block
  • Open the page or post that you wish to add a form to.
  • Click the plus sign to add a new block.
  • In the Search for a block field, type gravity or form.
  • Under Embeds, click on Form. This will insert the Gravity Forms block.
  • Click the Select a Form drop down and choose your form.
Oct 9, 2023

How do you create a user with Gravity Forms? ›

Simplify User Registration

Log in to your WordPress site and create a user registration form using Gravity Forms. Add the Name, Password, and Email advanced fields to your form. It might look something like this: Next, go to Settings > User Registration to access feed settings and create a new form feed.

How do you add a formula to Gravity Form? ›

Creating a calculation formula
  1. Add 2 different number fields and name them First Number and Second Number.
  2. Save your form, it is important to do this so the newly added fields are available when setting up the calculation formula in later steps.
  3. Add a third Number field which will handle the result of the calculation.
Mar 18, 2024

How do I save a Gravity Form as a PDF? ›

The basic plugin is free, so all you need to do is log into your WordPress site, hover over Plugins, click Add New and search for “Gravity PDF”. After installing Gravity PDF, navigate to your Form and click on Form Settings. Here you'll see a new tab called “PDF” which allows you to configure new PDF exports.

References

Top Articles
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 6422

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.