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.

I can't fix the padding/spacing on a form with CSS

  1. I've been trying everything I can but am at a loss to solve a spacing problem.
    We are moving to a new theme, and it's causing problems with the gravity forms spacing.

    On this (old) site, the "please subscribe" form has nice tight vertical spacing:
    http://insulinnation.com/stemming-the-tide-of-immune-response/

    but on this (new) site, the same form, the same form code, displays with excessive vertical spacing:
    http://newinsnat.epscomm.com/stemming-the-tide-of-immune-response/

    I can't figure out what CSS to change. Nothing seems to work for me. Can you inspect it and suggest some things to try?
    Thank you.

    Posted 12 years ago on Thursday April 25, 2013 | Permalink
  2. In style.css this rule

    .widget li {
    border-top: 1px solid #F6F6F6;
    margin: 0;
    padding: 7px 0;
    }

    Adds 7px padding top and bottom of the li.

    And base.css has this:

    input[type="text"], input[type="password"], input[type="email"], textarea, select {
    background: none repeat scroll 0 0 #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 2px 2px 2px 2px;
    color: #777777;
    display: block;
    font: 13px "HelveticaNeue","Helvetica Neue",Helvetica,Arial,sans-serif;
    margin: 0 0 20px;
    max-width: 100%;
    outline: medium none;
    padding: 6px 4px;
    width: 210px;
    }

    Which is adding 20px margin to the bottom of the input

    Adding this to style.css will help:

    div.ginput_container .large {
    margin-bottom: 0;
    }

    And this will help a bit more:

    li.gfield.gformlee {
    padding-bottom: 0;
    }

    I'm no expert and there are probably several ways to do what you want. I think this might show you which elements attract the CSS rules that are applied. The thing is using sufficient specificity to apply to only the elements you are interested in.

    The other thing is where you put it. If you are using a child theme then it is in you child theme's style.css. If you put it elsewhere remember it will get overwritten if you update that component of your site.

    Martin

    Posted 12 years ago on Thursday April 25, 2013 | Permalink
  3. Many, many thanks Martin! That helped a lot!

    Posted 12 years ago on Thursday April 25, 2013 | Permalink

This topic has been resolved and has been closed to new replies.