How can I change the background colour of a Marketo Form?

MartinZ1
Level 2

How can I change the background colour of a Marketo Form?

Hi I want to change the background colour of a Marketo form that I am embedding via HTML. I have tried add a CSS tag but it just ends up turning the whole page to the background colour. 

2 REPLIES 2
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: How can I change the background colour of a Marketo Form?

Well, if you'd like to add background-color to a particular form on the webpage you can add the background-color property to the form element's id, like below:

 

<style>
#mktoForm_<form-id> {
  background-color: yellow;
}
</style>

 

Also, w/o the URL to the page it's gonna be difficult to debug the CSS.

 

Dave_Roberts
Level 10

Re: How can I change the background colour of a Marketo Form?

If you'd like to be able to style any form that's placed onto the page you could try the following CSS:

 

<style>
form.mktoForm {
 background-color: yellow;
}
</style>

This will style the form element's background color and should work for any form you place onto the page. In most cases I've seen you'll probably want to add some padding around the form as well so it looks more comfortable atop the background like so:

<style>
form.mktoForm {
background-color: yellow;
padding: 30px 30px 30px 30px; /* top right bottom left */
}
</style>