How to Create Responsive Marketo Forms


Marketo forms, by default, have set widths for many elements including all the form fields, labels and even the form itself. If you’re embedding your form in a responsive landing page, you might want to make the form fully responsive as well. With a bit of CSS, you can make your one-column and two-column Marketo forms look great on every device.

Single Column Forms

Single column forms are easy to make responsive. All you have to do is override some pixel widths with percentage widths. Here’s a breakdown of what elements have to be updated. If you just want to copy and paste the final code click here to jump to the final CSS.

Change the form width to a percentage

Marketo will give the form a fixed pixel width by default, so the first step is to switch the width of the form to a percentage. I usually change the form width to 100% and define the container width for the form in the landing page template.

Tip: Make sure you don’t leave out the !important declaration. Since Marketo adds width as an inline style to the form tag, this is the only way to override the inline styling.

Update .mktoFormRow, . mktoFormCol, .mktoButtonRow and .mktoFieldWrap to 100%

The next step is to update .mktoFormRow, .mktoButtonRow, . mktoFormCol and .mktoFieldWrap to 100%, like this:

Update the form fields to a percentage

All of the form fields have a fixed pixel width as well. Just like the form element, you have to add the !important declaration for this as well to override the inlines styles Marketo outputs.

Center the submit button

If you want to center the submit button on the form you can add this CSS:

The final CSS

A note about field label widths

Field labels have fixed pixel widths as well. However, I usually leave it that way since it doesn’t usually impact the responsiveness of the form unless the labels are more than 300px wide. Label widths can be updated like this:

Two-Column Forms

Two-column forms are a bit more complicated than single column forms. I’ve tried many ways to achieve a two-column Marketo form, including adding javascript to add classes to different form elements, but I prefer the CSS method better.

Drag your form fields into two-columns in the form editor

The first step is to use the form editor to create the two-columns.

Change the form width to a percentage

Update .mktoFormRow, .mktoButtonRow and .mktoFieldWrap to 100%

Update the form fields to a percentage

Update the columns to a percentage width

Add some padding between the two columns

Center the submit button

If you want to center the submit button on the form you can add this CSS:

Add a media query to stack the columns on mobile

This example uses the same breakpoint as the default Marketo CSS. Feel free to change it based on your requirements.

The Final CSS

The final CSS for the two-column form.


Send them to me via email, send me a tweet @jennamolby, or leave a comment

Related Posts

  • 23/09/2020
    7 Ways Pardot Users Can Use Chrome Developer Tools For Troubleshooting & Testing

    Chrome Developer Tools is widely used by developers to help edit pages on-the-fly and diagnose issues. Pardot users can use DevTools to troubleshoot and test landing pages and forms. In this post, I’ll show you 7 ways you can use DevTools, including how to identify errors on a landing page, how to customize the CSS of a form and how to view hidden form field values.

  • 23/07/2020
    How to Add an Opt-in Message & Privacy Policy Message to Pardot Forms

    GDPR and CASL compliance are just a few reasons to add an explicit opt-in message or a privacy policy to your Pardot forms. In this post, I’ll show you how to add a custom opt-in message to your form and a privacy consent message above the form submit button.

  • 23/06/2020
    How to Use Pardot Form Handlers

    Pardot form handlers allow you to use your own forms to post your data to Pardot. A Form handler is a great alternative to use instead of Pardot iFrame forms. They allow you to fully customize the look of your form and submit data to more than 1 database. In this tutorial, you will learn how to create a form handler from scratch.

8 comment(s)
  • Andrea

    30/01/2018 at 6:55 pm

    Hello Jenna! Thank you for this awesome instruction. I've got an embedded, single input field Marketo form on my WordPress site, and I've been trying to figure out how to center that input field. The button is centered, but the field will not budge unless I use margins to push it over! Any ideas? Here's one of the pages where I'm using the form:

    • Jenna Molby
      to Andrea

      31/01/2018 at 9:14 am

      Hi Andrea, Adding this CSS to your form should center the input. .mktoForm .mktoRequiredField label.mktoLabel { display:none; } .mktoForm .mktoGutter::before { content:'*'; color:red; } .mktoFieldWrap { float:none !important; margin:0 auto !important; width:300px; } Cheers, Jenna

  • Sonali Jadeja

    25/01/2018 at 11:29 am

    This is a great article! Thank you so much!! Has anyone tried 2 columns & 1 column field in the same form? I am trying to implement it where we capture first & last name in one row/two columns & email address in second row/1 column layout. Any inputs will be appreciated!

    • Jenna Molby
      to Sonali Jadeja

      25/01/2018 at 11:39 am

      Hi Sonali, Yes, I've done that before. Send an email to [email protected] with a link to your page and I can help you. Cheers, Jenna

    • Jon Yang
      to Jenna Molby

      02/04/2018 at 1:11 pm

      Hey Jenna! Thank you for the article but I am also trying to accomplish the same as Sonali. Could you assist?

  • Stephan

    29/09/2017 at 8:26 am

    Can you please enhance the code for a three column form? What CSS needs to be added?

    • Jenna Molby
      to Stephan

      29/09/2017 at 2:23 pm

      Hi Stephan, You would need to drag your fields into three columns within the Marketo form editor and then update the line of CSS for .mktoFormCol to around 33% instead of 50%. Hope that helps!

  • Tim Ball

    25/09/2017 at 9:35 pm

    Thanks Jenna, This is exactly what i have been looking for, great article.

Leave A Comment

Your email address will not be published. Required fields are marked *

About Me

Welcome to my blog, where I share, tips, tricks, thoughts and solutions that I learn in my daily life as a Marketing Operations leader.

Most Commented
Popular Posts