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.

Centering Fields in Form Widget

  1. ericreynolds007
    Member

    Is there a way that I can center fields in just a sidebar form widget? When I revise the GF CSS to reflect centered text-align, all of the forms' fields on my site are centered. How can I apply a text-align: center CSS for just the form widget?

    Posted 11 years ago on Wednesday November 7, 2012 | Permalink
  2. The widget has a "gform_widget" class applied to the containing list item so you can use CSS inheritance to target just the forms in that container.. for example

    [css]
    body .gform_widget .gform_wrapper input[type=text],
    body .gform_widget .gform_wrapper input[type=url],
    body .gform_widget .gform_wrapper input[type=email],
    body .gform_widget .gform_wrapper input[type=tel],
    body .gform_widget .gform_wrapper input[type=number],
    body .gform_widget .gform_wrapper input[type=password] {
    	text-align: center
    }

    Once you've targeted only the elements container in the "gform_widget" list container, then you can apply whatever rules you want and they will only apply to your forms in widgets.

    Posted 11 years ago on Thursday November 8, 2012 | Permalink
  3. ericreynolds007
    Member

    Thanks Kevin. :)

    Posted 11 years ago on Thursday November 8, 2012 | Permalink

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