Gravity Forms CSS Visual Guide

View Guide (HTML Version) | Download Guide (png)

We've put together a simple visual guide to help illustrate the structure of a form and the CSS class relationship.

Basic Structure

Gravity Forms are structured so that every element can be targeted and manipulated via CSS. Most elements share reusable class names to affect styling, and many elements have unique ID's that you can use to target specific elements within the form. By using CSS inheritance, you can effectively style every element in your form.

All element ID's are based on the unique form ID and then a field ID. For example: #gform_wrapper_xx where "xx" is the form ID or #field_xx_yyy where "xx" is the form ID and "yyy" is the field ID.

Configurable Classes

There are 3 label classes that are applied based on the individual form settings, .top_label, .left_label and .right_label. Other elements change positions, widths, etc. based on inheritance from these label classes. Only the "top_label" class is represented in this example. Additionally, for many of the individual fields, there are classes of .small, .medium and .large which are also defined in the form admin.

Finally, for most of the fields, the user can define additional class names in order to apply additional custom styles or to target elements for other types of manipulation.

About Kevin Flahaut

Kevin Flahaut

Kevin is a a partner at Rocketgenius, Gravity Forms developer, Webby Award nominated designer & front end developer.

He's also a Star Wars fan (not the lame prequels), native Texan, has too many motorcycles (6 or so depending on the day), digs Apple products, loves Public Broadcasting, nature, science & travel shows, loathes reality TV, enjoys cooking & wine tastings, loves to joke around & relive his childhood (via eBay). He also tries not to take life too seriously if he can avoid it.

Twitter: @kflahaut
email:

One Response to "Gravity Forms CSS Visual Guide"
  1. needmore says:

    Very handy, thanks for making this guide!