Skip to main content

CSS classes and inline styles

What it does​

The builder has two kinds of styling fields, on the form, on each section and on each field:

  • A CSS class is a name, such as cushion-refresh. It changes nothing on its own. It gives whoever writes your theme's CSS a handle to style that one form, section or field.
  • An inline style is a short list of CSS rules, such as background:#f6f1ea;padding:16px 20px. It applies as soon as you publish, with no theme change.

Use them when one form or part of a form should look different from the rest. For a change to every form in a store view, use the Appearance settings instead.

Before you start​

  • For a class: someone who maintains your theme's CSS and can add a rule for it. WebForms has no box for your own stylesheet in the admin.
  • For an inline style: a few CSS rules, each written as property:value and separated by semicolons.
  • The form is open in the builder. Go to Content → WebForms → Manage Forms and click the form's name. If the form has a draft, click Open Draft. Otherwise, click Form Builder.

Steps​

Style the whole form​

  1. In the builder, click an empty spot of the canvas, so the right panel shows the form.
  2. Click the Appearance tab.
  3. Click Advanced to expand it.
  4. If you want a class, enter one or more names in CSS Class, separated by spaces, for example cushion-refresh.
  5. If you want a style, enter your rules in CSS Style, for example border-top:4px solid #8a5a2b.
  6. Click Publish Changes.

Style one section​

  1. Click the section's title on the canvas.
  2. Click the Appearance tab.
  3. Click Advanced to expand it.
  4. If you want a class, enter it in CSS Class.
  5. If you want a style, enter your rules in CSS Style. For a light box behind the section, enter background:#f6f1ea;padding:16px 20px;border-radius:8px.
  6. Click Publish Changes.

Style one field​

  1. Click the field on the canvas.
  2. Click the Appearance tab.
  3. For a class on the block that holds the label, the input box and its messages, enter it in Container Classes.
  4. For a class on the input box itself, enter it in Input Classes.
  5. For rules on the input box, enter them in Inline Style, for example min-height:140px on a Textarea.
  6. Click Publish Changes.

Every field setting on that tab is described in Field layout and style.

What you should see​

  • An inline style shows on the storefront after you publish. The canvas in the builder already shows a section's CSS Style, so a background color appears there while you work.
  • A class is added to the form, section or field on the storefront page. It looks the same until your theme has a rule for it.
  • A form's CSS Style is applied after the Appearance settings, so its rules win where both set the same thing.

Each of these settings reaches the storefront page on Luma and on Hyvä.

Limits​

  • An inline style is a fixed look. To change it later, edit it on each form, section or field where you entered it.
  • A class needs a rule in your theme's CSS, which your developer adds. Where it goes differs between Luma, Hyvä and Breeze. See Theme and template overrides.
  • Your developer can also style forms without your classes, using the names in Styling contract. WebForms keeps those names stable; if one ever has to change, the contract's version number goes up, so your developer can tell.

Troubleshooting​

  • The class has no effect. Ask your developer whether your theme has a CSS rule for that exact class name, and whether that rule is live on the store.
  • The style has no effect. Check the spelling of each property and the semicolon between rules, then click Publish Changes.
  • The section box shows in the builder but not on the store. The draft isn't published yet. Click Publish Changes.

What's next​

Applies to WebForms 4Last reviewed October 14, 2026