
Contact Form 7 is a powerful plugin that lets you build custom HTML contact forms for your visitors. If you want to change how your forms look and feel, you can do so easily with CSS in your WordPress site. And if you have no experience with HTML or CSS (or simply don’t want to learn it), the CSS Hero plugin lets you style your forms without writing any code.
In this tutorial, you’ll learn all about Contact Form 7 styling and how to apply CSS to your forms.
To add the form to a page or post, simply copy and paste the form’s Shortcode into it.
The below image illustrates a Contact Form 7 default form which contains – name, email, subject and your message fields.

As you can see, the form looks very basic and has no real styling. You can style it using your WordPress theme’s CSS file, which is usually located in the theme’s folder and named style.css.
Note that when Contact Form 7 generates a form, it creates a div with the class wpcf7 and puts all the form controls inside it. I’ll use this wpcf7 class to style
You can inspect this HTML in your Chrome browser by right-clicking the page and selecting Inspect. This shows you the HTML structure of the form.

Open the style.css of your WordPress Theme in notepad or any text editor. Scroll down to it’s end and start adding the following CSS styles to it.
Style
div.wpcf7 {
background-color: lightpink;
border: 1px solid Orange;
padding: 20px;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
background-color: rosybrown;
color: #FFF;
font-family: 'Arial Rounded MT';
font-style: italic;
}
.wpcf7 input[type="submit"] {
background-color: rosybrown;
text-transform: uppercase;
color: #FFF;
padding: 5px 10px;
}
You can style the form however you like by changing the colors, fonts, padding, and more. I’ve only given a brief introduction to using CSS with forms, but once you know the basic procedure, you can do much more.
The CSS styles we created for the form above apply to every form on your website. So if your site has 10 forms, all 10 will have a light pink background with an orange border.
The text, email, textarea, and submit elements inside the form will get the same styling. If you want to style each form differently, update the CSS to target the div’s ID instead of its class, as I did in the previous section.
First, find the ID of the div created by the CF7 plugin by right-clicking the page and selecting Inspect.

In the image above, the form’s ID is wpcf7-f4-p2-o1. Keep in mind that your form will have a different ID.
Next, update the CSS we created earlier by replacing .wpcf7 with #wpcf7-f4-p2-o1. That’s it! The style now applies only to the single form with the ID wpcf7-f4-p2-o1, and every other form on your site stays unchanged.
Repeat this process with each form’s unique ID to give every Contact Form 7 form on your website its own custom style.
div #wpcf7-f4-p2-o1{
background-color: lightpink;
border: 1px solid Orange;
padding: 20px;
}
#wpcf7-f4-p2-o1 input[type="text"],
#wpcf7-f4-p2-o1 input[type="email"],
#wpcf7-f4-p2-o1 textarea {
background-color: rosybrown;
color: #FFF;
font-family: 'Arial Rounded MT';
font-style: italic;
}
#wpcf7-f4-p2-o1 input[type="submit"] {
background-color: rosybrown;
text-transform: uppercase;
color: #FFF;
padding: 5px 10px;
}
If you don’t know CSS and HTML, the CSS Hero plugin can help. It lets you style not just your forms but any part of your WordPress website, with no coding required.
I will now show how to style a basic Contact Form 7 form from the beginning. For this remove the previous CSS code, which I made in the above paragraph, from the style.css file of your WordPress theme.
Then follow these steps given below:
2. Click on CSS Hero icon on the right edge of the page.

3. The CSS Hero toolbar appears on the right, click the Top Blue Icon to start selecting elements.
![]()
4. You can now select the different areas of the form like text control, email control, submit button, form div, etc. Here I have selected the form’s div and had set its background color to light pink.

After styling the full form, it looks like –

I hope you found this tutorial helpful. You can now style Contact Form 7 forms easily, using either custom CSS or the CSS Hero plugin. If you have questions or feedback, please share them in the comments below.