PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Gravity Forms Styling With PREMISE Plugin

  1. Hi:

    I'm using the PREMISE plugin for landing pages. When creating one of these "posts," there is an in-page editor that allows the insertion of a Gravity Forms box. I've tried the editor's functions to center to Gravity Form, or to indent it -- but these don't work. (That's probably no surprise to you. ;=)

    The PREMISE Tech Support folks tell me that any CSS editing should be done in their "Styles" box -- essentially a template for landing pages. But what CSS to enter?

    I've reviewed the terrific GravityForms examples for creating multiple columns and other sophisticated designs. But what I haven't found is a simple CSS code that allows me to center a column of uniform fields on the page and surrounding these with a gray-scale "container" box. Can you point me in the right direction -- or provide a code samples where I can adjust padding and position for these elements? (It goes without saying that I'm clueless about CSS!)

    Sorry I don't have "live" pages for you to analyze. But pLease see the four sample images on this page https://www.archetypecommunications.com/sample-image-for-gravity-forms-support/ . If there is some way you can provide code to get me "in the ballpark," I'm happy to experiment with plugging in different values for padding, etc.

    Thanks for your help!

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  2. It will be difficult to provide exact examples to you in each case, but maybe this will help get you started.

    http://www.gravityhelp.com/documentation/page/CSS_Targeting_Samples

    There is an explanation on that page of the structure of each form. To put your form in a grey box, which is narrower than the surrounding content you probably want to do something like this:

    [css]
    body .gform_wrapper {background: #696969; color: #FFFFFF; width: 600px; padding: 5px; margin:10px auto;}

    That will give the form wrapper a grey background, white text, 600px wide, and centered horizontally (that's what the auto will do, automatic left and right margins.)

    That is the wrapper around the whole form. As you go down that CSS Targeting documentation page, the targets get more and more specific. With a little experimentation, I think you will find you can target any element within a Gravity Form. If you need help targeting elements specifically, we may need to see the live form to ensure our suggestions work.

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  3. Hi Chris:

    Thanks for your prompt response!

    Although I had found that very useful samples page you suggested, I didn't see a relatively simple example for centering a column of uniform fields. (IMAGE 3 on the link I previously sent shows my experiment in using your CSS snippets to isolate and identify the fields; now I just need to know how to style them.) But now you've given me a code sample to "kick start" my experiment. Very much appreciated...

    When I get time to work on this today, I'll see how close I can come to a workable solution. If it needs "fine-tuning," I'll send you a link to that live page.

    Meanwhile, can you offer any counsel about using GravityForms with the Premise plugin? Did you understand my question about where to enter code when using BOTH Gravity Forms and Premise for the same landing page? (Does one CSS entry box override the other?)

    I also am integrating MailChimp with some of my landing pages and contact forms. Although the MailChimp design works well enough, some of its code (such as the button text) is "hard-wired" -- so I'd prefer to have the flexibility that GravityForms offers. Can I take the CSS created in Premise/GravityForms and drop that into MailChimp as a custom design? (I'd try it myself -- but when attempting a custom design in MailChimp, that program automatically wipes out any previous templates; so I'd like to know that there's a good possibility of this working.)

    Again, I really appreciate your responsiveness. In just a few hours you've given me more useful information than I've received in several DAYS from other sites.

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  4. For centering fields, I think you mean this example?
    https://www.archetypecommunications.com/wp-content/uploads/2011/09/Contact-Form-Problem-1-copy-2.jpg

    If so, you will have to do a couple things. You will have to center the form description, the labels and inputs, and the submit button. It's all possible if you look at the source of the form to get the elements you need to target.

    Here's an example like your screenshot with centered fields:
    http://gravity.chrishajer.com/contact-us/

    Here's the CSS I needed to add to my theme's style.css. I used #gform_wrapper_32 here to apply only to form 32. You can use .gform_wrapper instead and this CSS will apply to all forms.

    [css]
    body #gform_wrapper_32 {
    width:598px;
    border:1px solid #C2C2C2;
    padding:5px;
    }
    body #gform_wrapper_32 .gform_heading span.gform_description {
    color:red;
    display:block;
    text-align:center;
    }
    body #gform_wrapper_32 .gform_body ul li.gfield {
    text-align:center;
    }
    body #gform_wrapper_32 .gform_footer input[type='submit']  {
    color:#FFFFFF;
    background:red;
    float:none;
    display:block;
    width:140px;
    margin:0 auto;
    }

    Regarding where you add the CSS with Premise and Gravity Forms: you never modify the CSS that is included with Gravity Forms. You always add the CSS to wherever it works for your theme. The way CSS works is that rules are inherited. The default Gravity Forms CSS will be overridden by more specific rules that are included by your theme. The rules I have given here are usually more specific than the general rules included in most themes. So, I don't think it matters that you are using Premise. Sounds like you will add it to their styles box, which will apply it to the page where you embed this form.

    Regarding MailChimp, I'm not sure. But in MailChimp you have the ability to save multiple templates. It should not be wiping out your existing templates. I would figure out how to create a new template there (there is a save option, and a rename and save, which works like "copy") and experiment. Post here if you need additional help.

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  5. Hi:

    The live page is viewable here:
    https://www.archetypecommunications.com/call-at-617-8581376/

    Also, FYI, this is the message that shows up in the PREMISE editor window when I toggle the inclusion of a GravityForms form:

    VISUAL:
    [gravityform id=1 name=CONTACTUS... ajax=true]

    HTML:
    [gravityform id=1 name=CONTACTUS... ajax=true]

    Any red flags here? (For example: Since the code generated here calls itself "id=1" does that mean I should replace "1" with all the places where "32" appeared in the code you provided?)

    As you suggested, I plugged in the code from your post above. I stripped out the references to #32." (As shown below.) But still the code is not "expressing" on the page. I also have tried clearing my browser's cache, and also the WordPress cache.

    I'd very much appreciate your taking a look at the live page -- as I very much want to activate some landing pages this weekend. Thanks!

    01
    body #gform_wrapper {
    02
    width:598px;
    03
    border:1px solid #C2C2C2;
    04
    padding:5px;
    05
    }
    06
    body #gform_wrapper .gform_heading span.gform_description {
    07
    color:red;
    08
    display:block;
    09
    text-align:center;
    10
    }
    11
    body #gform_wrapper .gform_body ul li.gfield {
    12
    text-align:center;
    13
    }
    14
    body #gform_wrapper .gform_footer input[type='submit']  {
    15
    color:#FFFFFF;
    16
    background:red;
    17
    float:none;
    18
    display:block;
    19
    width:140px;
    20
    margin:0 auto;
    21
    }

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  6. A couple things to note. The #gform_wrapper_32 should be replaced with .gform_wrapper. The # is a unique ID, the dot is a class. There's a difference, so you have to use .gform_wrapper with the leading dot.

    Also, it looks like you pasted in line numbers from my example. Not sure if that happened here or in your theme, but you need to paste it in with no line numbers. Those are for display only.

    Please use this copy and see if things work:
    UPDATED LINK: http://minus.com/mFYfE2Eyw

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  7. Looking at your live page and this stylesheet:
    https://www.archetypecommunications.com/wp-content/uploads/premise/settings-8.css?ver=1314982993

    It looks like it got pasted in there with line numbers. Try the plain text version I posted here http://minus.com/mFYfE2Eyw (UPDATED link)

    The shortcode you posted about looked fine. The id=1 means this is form ID #1 which should not be altered.

    Posted 13 years ago on Friday September 2, 2011 | Permalink
  8. Thanks, Chris:

    Using your plain text, the code is working here:

    https://www.archetypecommunications.com/auto-draft-4?preview=true&preview_id=2265&preview_nonce=7cb7436023

    Now we at least can see the changes as we make them...

    That "Captcha" box is a little hard to work with, in terms of getting a uniform look to the column of fields. A couple of questions on that:

    1) Is there another type of spam-prevention field that is readily available?

    2) In your experience, is "Contact Form spam" enough of a problem to make this Captcha form a necessity?

    Thanks!

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  9. We can't view your form preview without being logged in.

    If you don't like CAPTCHA, you can install the ReCAPTCHA plugin which may suit you a little better.

    That said, I had CAPTCHA in general and have never had the need for one. Obviously, higher traffic sites have to implement them.

    One thing I do on all my forms is check the "Enable anti-spam honeypot" on the Advanced tab of the form settings. That adds a hidden field to your form that visitors will not see, but bots will. Bots will fill it out, and when Gravity Forms sees this field filled out, it is assumed to be spam.

    Finally, in version 1.6 (currently in beta release) the Akismet anti-spam solution has been integrated. I think that will help reduce spam as well.

    You could also leave off CAPTCHA for now and implement it if spam becomes a problem.

    Posted 13 years ago on Tuesday September 6, 2011 | Permalink
  10. Still having problems with a couple of pesky CSS edits:

    1. I can't get the plain text copy to center over the column of input boxes. (The form's headline and subhead are centering just fine. But once I'm in the ".gform_body" I can't get the left-aligned text to move. I couldn't tell exactly what the code designation for this text area is -- so I went down the GravityForms stylesheet and plugged in centering CSS for each of them. Nonetheless, the text doesn't move.

    2. Although I can change the color and text of the "SUBMIT" button in the footer...I still am unsuccessful at getting this to center.

    Any suggestions?

    Form page is here:
    https://www.archetypecommunications.com/auto-draft-4/

    Here's the code:

    http://pastie.org/2511943

    Thanks again!

    Posted 13 years ago on Friday September 9, 2011 | Permalink
  11. I'm not sure what "plain text" your referring to in point one. I don't see anything but the form title and the fields. The title doesn't look centered though.

    As for the button, you can add the !important declaration to line 44 here. That will force the auto margins.

    [css]
    body .gform_wrapper .gform_footer input[type='submit'] {
    	color:#FFFFFF;
    	background:red;
    	float:none;
    	display:block;
    	width:160px;
    	margin:0 auto !important;
    }

    screenshot: http://bit.ly/nbcTsy

    Also, you have some errors in your rules. You've got commas rather than periods/dots in front of some class names. That's probably why they're not working for you. Here's the erroneous portion.. note the commas before "gform_body"

    [css]
    body.gform_wrapper ,gform_body .gform_fields .top_label {
       text-align: center!important;
    }
    
    body.gform_wrapper ,gform_body .gfield {
       text-align: center!important;
    }
    Posted 13 years ago on Saturday September 10, 2011 | Permalink
  12. All very helpful, Kevin. Thanks!

    Posted 13 years ago on Tuesday September 13, 2011 | Permalink
  13. Nick
    Member

    Any suggestions as to why the form isn't centering here: http://aquaviews.net/fbtab/contest-entry/

    Thanks!

    Posted 12 years ago on Friday January 27, 2012 | Permalink
  14. Nick, try placing this into your theme's stylesheet:

    [css]
    .ginput_container {
    text-align: center;
    }
    Posted 12 years ago on Friday January 27, 2012 | Permalink
  15. Nick
    Member

    Getting closer, but the check box is over to the left instead of next to the associated text. I guess the radio options in the original example site are like that too, now that I look at it.

    Posted 12 years ago on Friday January 27, 2012 | Permalink
  16. Try this, replace your current selector in your stylesheet (body .gform_wrapper) with this:

    [css]
    body .gform_wrapper {
    width: 285px;
    border: 1px solid #C2C2C2;
    padding: 5px;
    margin: 0 auto;
    }
    Posted 12 years ago on Friday January 27, 2012 | Permalink
  17. Nick
    Member

    My hero! :)

    Posted 12 years ago on Friday January 27, 2012 | Permalink