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.

Dropdown menu same style as text field

  1. Hello,

    I would like the dropdown menu to look the same as the the text field. How can I best achieve this?

    I change both of the width to 100% but the dropdown menu is still 10px smaller.

    Thank you

    Posted 11 years ago on Thursday May 17, 2012 | Permalink
  2. Select elements are pretty tough to style uniformly, cross-browser as most of the styling is dictated by the browser. Do you have a link to your form so I can see what you have so far?

    Posted 11 years ago on Thursday May 17, 2012 | Permalink
  3. I have now only a 2px difference between the input fields and the select and text field.

    This is my test site.
    http://www.grappler.tk/dyebeta/contact

    Posted 11 years ago on Thursday May 17, 2012 | Permalink
  4. Yeah I don't think you're going to be able to match that up exactly, besides the contents of the drop down doesn't really need to be that wide anyways to accomodate prefixes. At any rate, you can isolate and try to target that field individually with:

    [css]
    #input_1_4 {
    width: 79% !important;
    -webkit-appearance: none;
    box-sizing: content-box;
    }

    You can also try taking off some of the browser-defined styles like the one example above.

    Edit: This is pretty close for webkit at least. Screenshot

    Posted 11 years ago on Thursday May 17, 2012 | Permalink
  5. Thanks, box-sizing: content-box was the solution

    I was trying to simplify the css and ruined everything. Could you tell me which class or id to use. I would like this to work for all of my forms.
    I would like to use use this style for all of fields except the submit button and...
    font-size: 16px!important;
    width: 80%!important;
    box-sizing: content-box;
    padding: 3px!important;
    ...this is for the text field.
    height: 20px;

    Posted 11 years ago on Thursday May 17, 2012 | Permalink
  6. You're not going to be able to universally apply this and have it exact because that select field you will most likely need to target individually. But you could try something like:

    [css]
    .gform_wrapper .right_label input.medium, .gform_wrapper .right_label select.medium, .gform_wrapper .left_label input.medium, .gform_wrapper .left_label select.medium {
    font-size: 16px!important;
    width: 80%!important;
    box-sizing: content-box !important;
    padding: 3px!important;
    height: 20px;
    }

    Here is the documentation on how the structure is laid out.

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

    You can also use tools such as chrome developer tools and firebug for firefox to inspect the elements and target them as you wish.

    Posted 11 years ago on Thursday May 17, 2012 | Permalink