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.

styling side-by-side input fields

  1. wraycodesign
    Member

    I've checked other posts but can't seem to find this. You've likely covered this already. I'm adding a custom class name to make it easier to style the smaller input fields side by side, but when designate a width it's giving me lots of extra space in between the fields. I've separated out the styling with the class name by itself and with "input" added but still it's not behaving as expected.

    I'm trying to get "phone" and "alternate phone" closer together but can't seem to.

    http://www.coachstrobl.com/scoringfactory/clinics/clinic-sign-up

    Thanks for any help.

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  2. You have to reset the widths on the actual inputs.

    body .gform_wrapper li#field_1_3 input, body .gform_wrapper li#field_1_15 input {width:92%!important}

    screenshot

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  3. wraycodesign
    Member

    Thanks Kevin. Just curious, though, why bother naming a class on the input?

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  4. it's about options. I chose to target the inputs in my rule with inheritance from the parent. If you prefer, you can get the id of the input itself and target it specifically by that.

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  5. wraycodesign
    Member

    If I'm understanding correctly, from your example above I would need to target each phone field separately. Originally I gave all my phone fields a class of "phone" and would like them all to behave the same way.

    When you include field numbers doesn't that limit your styling to just that field?

    Sorry to be a bother...

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  6. Sure, if you want to style all the fields the same - everywhere, simply use the class name for the rule. Most people don't want to do that, so the id's are there if you want to limit it.

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  7. Basically it's taking an object oriented approach.

    GF has default 'parents' and allows easy modifications through it's children.

    You can redefine a parent class to style your phone field, or write your own rules...it's up to you and your comfort with CSS. One thing does stay the same, however, is the nesting. To access any form field you do need to define the nesting path:

    .gform_wrapper => .gform_body => .gform_fields => .gfield => New_Input_Class

    Posted 14 years ago on Monday November 22, 2010 | Permalink
  8. wraycodesign
    Member

    urmedia,

    You read my rather simple mind! Thank you! Kevin, thanks again for your quick responses.

    Amanda

    Posted 14 years ago on Tuesday November 23, 2010 | Permalink

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