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.

Horizontal form layout

  1. walt
    Member

    Currently I'm working on a form with, on a few lines, 2 single line text fields next to each other.

    To position the two 2 single line text fields on the same line I'm using the following css:

    /*left section*/
    #field_2_3, #field_2_4, #field_2_8,#field_2_15,#field_2_17{
    float: left;
    width: 45%;
    clear: both;
    }
    
    /*right section*/
    #field_2_16,#field_2_18{
    float: left;
    width: 45%;
    }
    
    .button{
    float: left;
    width: 100px;
    margin: 15px 0px 0px 0px;
    clear: both;
    }

    an example can be seen here:

    http://dev.villageocelandes.fr/huren

    I have the following questions:

    1. the css I'm using seems not to work well with IE7. How can this be fixed?
    2. How can I expand some of the input fields? Now they all the same size.

    Also suggestions for a different css approach are more than welcome. It would be nice to have a video tutorial on how to position 2 or more fields on the same line.

    Thanks,
    Walt

    Posted 14 years ago on Saturday December 12, 2009 | Permalink
  2. you're headed in the right direction.. just need to float the first < li > left and let the next one automatically wrap to the right of it. I put a css snippet up on a previous post that worked fine in all the browsers.

    http://forum.gravityhelp.com/topic/data-fields-in-same-row#post-878

    You can target the input fields directly by using their id as in the example below.

    input#input_2_15 {width:230px;}
    input#input_2_17 {width:250px;}

    I plan to add some styling tutorials and examples after the first of the year. Thanks for the feedback.

    Posted 14 years ago on Sunday December 13, 2009 | Permalink
  3. walt
    Member

    Thanks for the prompt response. It seems to work fine when I use the css below:

    li#field_2_15, li#field_2_17 {width:55%; float:left}
    li#field_2_3 {clear:both}
    
    input#input_2_15, input#input_2_17 {width:296px;}
    input#input_2_16, input#input_2_18 {width:200px;}

    Thanks again,
    Walt

    Posted 14 years ago on Sunday December 13, 2009 | Permalink
  4. Great. I'm glad it worked for you. Thanks for the update.

    Posted 14 years ago on Sunday December 13, 2009 | Permalink