Skip to main content
Each form’s layout depends on the form type, i.e., whether it collects contacts or clicks. In this guide, we’ll go over some common principles for both layouts.

HTML

General guidelines

  • You can start your layout with <div>, with "popmechanic-reset" and id="popmechanic-form" classes. The <!DOCTYPE html> or <header> tags are not required.
  • The "popmechanic-main" class wraps the main screen of the subscription form.
  • Any element that is used to close a form should use "data-popmechanic-close". No additional scripts are needed:

Forms that collect contacts

As contact collection forms send some customer details to Maestra, they should contain at least one input field and one confirmation button:
More on input and validation fields In your contact collection form, you can add a Thank You screen and wrap it in the "popmechanic-thankyou" class:
Ready-to-use example:

Data submission forms

If you need to count clicks on your embedded form’s URL or button, add "data-popmechanic-submit" to this URL/button.
If you have several buttons with this parameter in your form, all click counts will be aggregated in the report. Ready-to-use example:

CSS styles

Style parameters to fit various screen sizes

Avoid using media requests to create a pop-up form. Maestra’s script uses the "popmechanic-desktop", "popmechanic-tablet", and "popmechanic-mobile" classes in the pop-up container to adapt it to different devices. Classes reserved for styles:
  • #popmechanic-form — all the form screens;
  • .popmechanic-mobile — the mobile version of a screen;
  • .popmechanic-tablet — the desktop form version;
  • .popmechanic-thankyou — the “Thank You For Subscribing” screen.
To create custom CSS form styles, place #popmechanic-form at the beginning of the selector as shown below:

Adding custom fonts to your form

Recommended:

Adding a video to your form

Limit your GIF animation by 2 MB. The video can be used as a background for the form:
For more information on how to handle video in your forms refer to How to Create a Pop-Up with a Video.

Multiscreen forms

When you design a multiscreen form or a form with a Thank You screen, hide all the screens except the first one.
Example: The form button styles are described below