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.

fields stretching across the whole page

  1. kshaw
    Member

    can someone tell me how to remove space between fields that have been put side by side?
    And what about limiting the size of the field so it doesn't stretch across the whole page, is that possible. maybe a setting i have wrong? here's a link to a form i have started

    http://aisinsured.com/blog/get-a-quote/homeowners-quote

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  2. You can limit the size of your form by defining a set width for the wrapper div. You would add this to the end of your theme's style.css file.

    [css]
    body #gform_wrapper_1 {width:640px)

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

    For the side-by-side fields, they're set to use 50% of the available width for the 2 column layout. You just want them side by side so you can replace the "gf_left_half" and "gf_right_half" ready class names with "gf_inline" for both. That will put them side by side, but not into equally spaced columns. That's more what you want here.

    screenshot: http://grab.by/a5QD

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  3. Is there a way to change the height of the fields?

    Also, the font and the color of the input text?

    Thanks in advance.

    Chris

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  4. Yes, examples of how to target/manipulate the inputs with CSS is in the documentation here.

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

    Look for the section on "standard fields"

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  5. Thanks for that really quick response, Kevin.

    I'm still struggling though. Any chance of a quick example?
    I've managed to change the width of the input boxes as per your instructions above but I'm just not sure what to change here:

    [css]
    body #gform_wrapper_1 {width:640px}
    .gform_body .gform_fields  .gfield input[type=text] {border:px solid red}

    I just want the boxes to be a little bigger in height and to be able to change the colour and font when someone types in their details. I've worked out how to change the labels but just can't figure out the rest.

    Sorry to be a pain, but I'd really appreciate it if you could give me an example.

    Thanks

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  6. You would do something like this. It targets all of the normal input styles & selects (drop downs) so you can define a height and/or other properties. There is a separate rule that includes textareas (paragraph text) to declare the font style, color, etc.

    [css]
    /* reset the form wrapper width */
    
    body #gform_wrapper_1 {width:640px}
    
    /* define the heights on the inputs and selects */
    
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=text],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=email],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=tel],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=url],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=password],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield select {
    	height:24px;
    }
    
    /* change the font color and styles for the inputs, selects and textareas */
    
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=text],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=email],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=tel],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=url],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield input[type=password],
    body #gform_wrapper_1 .gform_body .gform_fields .gfield select,
    body #gform_wrapper_1 .gform_body .gform_fields .gfield textarea {
    	color:#f00;
    	font-family:sans-serif;
    	font-style:italic
    }

    Note: to change to a different style on fields that have been completed you'll need to add some kind of jQuery scripting to add a new class name and then define that new class in your CSS. It's not something you can do with just a CSS change itself.

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  7. Thanks very much, Kevin!

    Did what you said and it's all working fine!

    Really do appreciate it!

    Cheers!

    Chris :)

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  8. @CG, My pleasure. Thanks for the update.

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  9. kshaw
    Member

    Kevin,

    i was able to fix the side by side- thank you- however after adding body #gform_wrapper_1 {width:640px) to the style.css file in the editor i get no change. i'm using flexibility 3 theme and they do have a custom css and style code section in their theme options so i tried it there also and still got no change. any ideas? thanks again- keith

    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  10. Not sure. I'm not familiar with that theme at all. You just want to put that at the end of whatever stylesheet gets loaded on the page. From what I see, it's the style.css file.

    When I add it in my test (via the firebug inspector) it works just fine.

    screenshot: http://grab.by/a5Vu

    You can try adding the !important declaration, but you shouldn't need it from what I can tell.

    [css]
    body #gform_wrapper_1 {
        width: 640px!important
    }
    Posted 12 years ago on Tuesday May 10, 2011 | Permalink
  11. Sorry, Kevin,

    Just a little adjustment to my "...it's all working fine." comment above.
    Just checked something that I didn't check last night and it's not quite right.

    I have the following fields:

    1. Name:
    2. Email:
    3. Phone:
    4. Country: (single line text field)
    5. Type your enquiry here (paragraph text field)

    I've managed SUCCESSFULLY to change:

    * the height of the input boxes
    * the font, color and size of the text labels
    * the font, color and size of the input text

    for ALL EXCEPT number 5: Type your enquiry here (paragraph text field)

    The only thing I was able to change was the text color... not the size or the font?
    I just can't figure out why?

    Any ideas would AGAIN be appreciated!

    Here is the code:

    [css]
    body #gform_wrapper_1 {width:450px}
    .gform_body .gfield input[type=text] {height: 20px; font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #636363;}
    .gfield textarea {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #636363;}
    .gfield_label {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #8a8a8a;}
    .gfield select {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #8a8a8a;}

    I am correct in thinking that the problem field is .gfield textarea ?

    I even tried giving it a custom class name : CG-txt
    and tried:

    body #gform_wrapper_1_CG-txt .gform_body .gfield textarea {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #636363;}

    but that didn't work so I am clearly barking up the wrong tree with that one.

    As I say, any more of your very handy tips, Kevin, would help me sleep better tonight :)

    Cheers

    Chris

    Posted 12 years ago on Wednesday May 11, 2011 | Permalink
  12. You don't need to add extra classes to change anything, you just need to target the textarea element for the "paragraph text"

    In the previous example, I purposely omitted the textarea from the first rule because you probably didn't wan't a textarea to be defined as the same height as the other inputs. If you want to define specific properties for that, you could create a simple rule for that field.

    [css]
    /* reset the form wrapper width */
    
    body #gform_wrapper_1 .gform_body .gform_fields .gfield textarea {
    	font-family: Arial, Helvetica, sans-serif;
            font-size: 1.1em;
            color: #8a8a8a
    }

    If that's not working, then it's probably inheriting some other rule from your theme. If you're targeting using the example above it should be fine. I don't see a URL to your form so I can't tell you for sure.

    Posted 12 years ago on Wednesday May 11, 2011 | Permalink
  13. You don't need to add extra classes to change anything, you just need to target the textarea element for the "paragraph text"

    In the previous example, I purposely omitted the textarea from the first rule because you probably didn't wan't a textarea to be defined as the same height as the other inputs. If you want to define specific properties for that, you could create a simple rule for that field.

    [css]
    /* reset the form wrapper width */
    
    body #gform_wrapper_1 .gform_body .gform_fields .gfield textarea {
    	font-family: Arial, Helvetica, sans-serif;
            font-size: 1.1em;
            color: #8a8a8a
    }

    If that's not working, then it's probably inheriting some other rule from your theme. If you're targeting using the example above it should be fine. I don't see a URL to your form so I can't tell you for sure.

    Posted 12 years ago on Wednesday May 11, 2011 | Permalink
  14. Thanks again, Kevin,

    You are a star!

    I did what you said and it worked a treat!

    Strange thing is though, I later managed to accidently delete
    the code you gave me above BUT found
    that it was working miraculously without it i.e. using the original code
    that was apparently not cutting it and hence my last cry
    for help.

    Really not sure how it worked but the fact is it does!

    For anyone that might be reading this thread, and
    possibly having similar issues, here is the final code
    that solved all my issues above.

    [css]
    body #gform_wrapper_1 {width:580px}
    .gform_body
    .gfield input[type=text] {height: 20px; width: 310px; font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #636363;}
    .gfield textarea {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #636363; width: 400px;}
    .gfield_label {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #8a8a8a;}
    .gfield select {font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; color: #8a8a8a;} 
    
    body #gform_wrapper_1 .gform_body .gform_fields .gfield select {border:1px solid #636363; font-size:0.9em; color:#636363; width: 315px; }

    Big, big thanks again to you, Kevin. I'm very pleased
    and equally impressed at the speed and usefulness
    of the help you are giving!

    Cheers

    Chris

    Posted 12 years ago on Thursday May 12, 2011 | Permalink
  15. Wonderful. Thanks Chris. I'm pleased I could help out.

    Posted 12 years ago on Thursday May 12, 2011 | Permalink

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