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.

Align form to the right

  1. nicole
    Member

    I am trying to align the form to the right.
    I copied the code I found on http://www.gravityhelp.com/forums/topic/align-form-to-the-right but it did not work.

    Could you please tell me how I do this.

    Posted 12 years ago on Saturday July 16, 2011 | Permalink
  2. Please post a link to your form. Thanks

    Posted 12 years ago on Saturday July 16, 2011 | Permalink
  3. Sorry, we don't have styles built in for the RTL (right to left) languages like Hebrew and Arabic just yet. It's been on my to-do list to finish but nothing completed and ready to go so far.

    You'll have to manually create the styles and float elements to the right instead of left for your form.

    I would add a custom class name "RTL" to your form in the form settings, then target that form with new CSS rules like this

    [css]
    body .gform_wrapper form.RTL ul li.gfield {
        text-align: right;
    }
    
    body .gform_wrapper form.RTL .gform_footer {
        text-align: right;
    }

    screenshot: http://bit.ly/r0NhyO

    That should get you started. You may have to write a few more similar rules for other elements, but it's easy enough once you have the idea. Once you've got that done, all you have to do is add the "RTL" class to any new forms and you should be good to go.

    Posted 12 years ago on Sunday July 17, 2011 | Permalink
  4. nicole
    Member

    Thanks very much. How do I include the form description so that it will be aligned too?

    Posted 12 years ago on Sunday July 17, 2011 | Permalink
  5. [css]
    body .gform_wrapper form.RTL .gform_heading {
        text-align: right;
    }

    screenshot: http://bit.ly/qjymOT

    You can find CSS samples for all the form elements here.

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

    Posted 12 years ago on Sunday July 17, 2011 | Permalink
  6. nicole
    Member

    Thank you.
    I looked at the link but I could not find something general for all fields in a form. Is there such a thing? I don't really understand CSS but is it possible to have something that would apply to all fields in a form? I have attached a form I made which includes most field types but only some are aligned. Does each field need to be included seperately?

    http://www.gan.yetzira.com/%D7%94%D7%95%D7%A1%D7%A4%D7%AA-%D7%92%D7%9F-%D7%99%D7%9C%D7%93%D7%99%D7%9D/

    Posted 12 years ago on Sunday July 17, 2011 | Permalink
  7. There is a wildcard rule (*) that you can use that will apply to everything in your form, but it may cause some layout issues somewhere else. I haven't tested it and don't like using it personally. I think it's better to write specific rules for each of the elements that you want to manipulate. If you're just using the text-align property though, it may work out just fine.

    [css]
    body .gform_wrapper form.RTL * {
        text-align: right;
    }
    Posted 12 years ago on Sunday July 17, 2011 | Permalink
  8. nicole
    Member

    Works perfectly! Thanks!

    Posted 12 years ago on Sunday July 17, 2011 | Permalink

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