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?
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?
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.
Thanks Kevin. :)