Contact Form 7 (CF7) is one of the most popular plugins available for WordPress. It allows users to quickly create customised forms, anywhere on a WordPress website.
While the forms are easy to create and implement, the fields within them are styled minimally – allowing them to blend in with most websites. The appearance of each CF7 form depends on the CSS styling applied to standard HTML form elements used in your current WordPress theme.
This article shows users, skilled at using HTML and CSS, how to styleStyle When you select a CF7 Skins Style the aesthetic design (CSS code) is automatically created and applied to your form. Contact Form 7 forms to their particular requirements.
Style Contact Form 7
Tl:dr (too long; didn’t read) version
- The Form Process
- Use Dev Tools to examine your CF7 form
- Examine CSS in your current WordPress theme
- Target CSS changes to CF7 forms only
- Use CSS to change the appearance of your CF7 form
You will need to be skilled at using HTML and CSS to follow along in this article. If that description does not fit you, you can learn all you need to know about both HTML and CSS at http://www.w3schools.com/ and come back to this article when you’ve done that.
You will also need to be skilled at using Firebug or Chrome Dev Tools to examine the HTML and CSS of your CF7 form in detail to follow along in this article. If that description does not fit you, you can learn about Firebug or Chrome Dev Tools and come back to this article when you’ve done that.
Table of Contents
- Default Contact Form 7 Form
- The Form Process
- HTML
- Use Dev Tools to examine your CF7 form
- CSS
- Default CF7 CSS style
- Examine CSS in your current WordPress theme
- Use a Child Theme to make changes to your CF7 forms CSS
- Target CSS changes to CF7 forms only
- You made need higher CSS Specificity
- Add CSS changes on individual CF7 form elements
- Copy current CSS with your Dev Tool
- Add CF7 classes & ids within your CF7 forms
- Use CSS to change the appearance of your CF7 form
- Targeting Specific CF7 Forms
Default Contact Form 7 Form
We use the default CF7 form (normally named “Contact form 1” & installed automatically on every install of the CF7 plugin) as the basis of this article.
The actual look of this default form on your WordPress website will depend on the current WordPress theme used on your website and the CSS styling that theme applies to standard HTML form elements.
In this case our website uses the The7 theme by Dream-Theme and the default Contact Form 7 form appears as follows:
Tip: The appearance of the default CF7 form on your WordPress website will depend on the current WordPress theme used and the CSS styling that theme applies to standard HTML form elements.
You may notice this form has a couple of styling issues:
- The labels don’t really stand out
- The Send button text is a little small.
In this article we’ll be demonstrating how to change the style of this form, using HTML and CSS, to meet particular requirements.
The Form Process
Forms are a common part of many websites and are a very powerful tool for interacting with users. They provide an easy way for visitors to your website to start a conversation with you about their particular requirements.
CF7 forms are based firmly on the more general HTML form process
While the CF7 plugin makes it quick and easy to create forms with little or no knowledge of HTML, Contact Form 7 forms are based firmly on the general HTML form process.
HTML includes a number of elements which are specifically designed for use in forms. The CF7 plugin provides support for most of the commonly used HTML form elements, including some recently added HTML5 elements.
Form appearance depends on the HTML form elements used and the CSS styling applied
The appearance of each CF7 form depends on the HTML form elements used

HTML for CF7 Form
and the CSS styling applied to these elements in your current WordPress theme.

CSS for CF7 Form
In any web form, the HTML provides the form content and layout (structure) of the form while the CSS controls the forms appearance and presentation (style).
HTML + CSS = FORM
HTML – form content and layout (structure)
CSS – form appearance and presentation (style).
HTML
The HTML in each CF7 form is created by the CF7 plugin based on information supplied by you in the Form section on the CF7 interface.

Form section of the CF7 interface
Any HTML elements added by you in the Form section on the CF7 interface are combined with HTML generated by the CF7 plugin.
HTML (supplied by you) + HTML (added by the CF7 plugin) = FORM Content & Layout (structure)
Standard HTML Form Elements
The default Contact Form 7 form uses label elements as the basis for the form.
While this is probably the simpliest way to create a form, it has a number of shortcomings, which we discuss in further articles – ( see Why we use Fieldset, Legend & Lists in CF7 Skins and Making your form easy to read by using Fieldsets ).
You can in fact use any HTML elements you want in the Form section on the CF7 interface and this is a key part of building CF7 forms that match your functional and appearance requirements.
With practice you can learn how to create increasingly complex CF7 forms by combining your HTML elements with those added automatically by the CF7 plugin.
HTML code + CF7 Tags in CF7 Form area
The box below shows the content of the Form section of the CF7 interface for the default CF7 form.
<label> Your Name (required) </label> <label> Your Email (required) [email* your-email] </label> <label> Subject </label> <label> Your Message [textarea your-message] </label> [submit "Send"]
As you examine this code you should notice that it includes:
- Standard HTML Elements –
- CF7 Tags –
[email* your-email]
The standard HTML Elements you add in this section are output largely unchanged by the CF7 plugin. CF7 then uses the CF7 Tags to create fully functioning standard HTML form elements which can include a number of additional HTML attributes.
If you are not sure how Contact Form 7 uses CF7 Tags you can read all about them at Contact For 7 Tag Syntax.
Completed HTML code in CF7 Form
The box below shows the complete HTML code generated on the actual website, based on information supplied by you in the Form section on the CF7 interface and the additional HTML code added by the CF7 plugin.
<div id="wpcf7-f235-p1192-o1" class="wpcf7"><form novalidate="novalidate" class="wpcf7-form" method="post" action="/example.com/styling-contact-form-7-forms/ #wpcf7-f235-p1192-o1"> <div style="display: none;"> <input type="hidden" value="8" name="_wpcf7"> <input type="hidden" value="3.4.1" name="_wpcf7_version"> <input type="hidden" value="wpcf7-f235-p1192-o1" name="_wpcf7_unit_tag"> <input type="hidden" value="1cc9dc2c57" name="_wpnonce"> </div> <p>Your Name (required)<br> <span class="wpcf7-form-control-wrap your-name"> <input type="text" aria-required="true" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" size="40" value="" name="your-name"></span> </p> <p>Your Email (required)<br> <span class="wpcf7-form-control-wrap your-email"> <input type="email" aria-required="true" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" size="40" value="" name="your-email"></span> </p> <p>Subject<br> <span class="wpcf7-form-control-wrap your-subject"> <input type="text" class="wpcf7-form-control wpcf7-text" size="40" value="" name="your-subject"></span> </p> <p>Your Message<br> <span class="wpcf7-form-control-wrap your-message"> <textarea class="wpcf7-form-control wpcf7-textarea" rows="10" cols="40" name="your-message"></textarea></span> </p> <p><input type="submit" class="wpcf7-form-control wpcf7-submit" value="Send"><img class="ajax-loader" src="http://buzztone.com.au/wp-content/plugins /contact-form-7/images/ajax-loader.gif" alt="Ajax loader sending..." style="visibility: hidden;"></p> <div class="wpcf7-response-output wpcf7-display-none"></div> </form> </div>
Take a moment to compare these two bits of code and notice where the information from the form section of the CF7 interface has made it into the HTML on the actual website.
Tip: If you unable to understand easily what is going on in the code included in these two boxes, you probably don’t have adequate skills to change the style of CF7 forms, without at least some external support or advice.
In that case you should continue to learn what you need to know about both HTML and CSS at http://www.w3schools.com/ and come back to this article when you’ve done that.
CSS classes & ids generated by CF7
You may notice that Contact Form 7 adds a number of CSS classes & ids to the individual HTML form elements – for example:
- <div> id=”wpcf7-f8-p275-o1″ class=”wpcf7″ > … <div> – for the complete form which is given a unique id
- <span> class=”wpcf7-form-control-wrap your-name”> … </span> – inline element which wraps each text field
These are added, by the plugin author, to allow users skilled at using HTML and CSS, to style their CF7 forms to their particular requirements.
Target CF7 classes & ids
The list of available classes that can be targeted within CF7 forms include:
- .wpcf7
- .wpcf7-form
- .wpcf7-form-control
- .wpcf7 input
- .wpcf7 input[type=”text”]
- .wpcf7 input[type=”email”]
- .wpcf7 input[type=”checkbox”]
- .wpcf7 textarea
- .wpcf7 select
- .wpcf7 select option
- .wpcf7 select option:hover
- .wpcf7 p
It makes sense to target these individual CSS classes available within your CF7 forms.
WordPress theme developers also can use these CSS classes & ids to build support for the CF7 plugin within their theme. As CF7 is one of the most popular plugins in WordPress, it makes sense for theme developers to do this.
Add CF7 classes & ids
You can also give your HTML form elements individual classes & ids within the CF7 tags in the Form section of the CF7 interface. This can be very useful when you have number of elements you want to style the same way.

CF7 tag with ID & Class
Use Dev Tools to examine your CF7 form
At this point you should use Firebug or Chrome Dev Tools to examine the HTML and CSS of your CF7 form in detail.
Default CF7 form in Firebug – Click on image to open a larger version
Use one of these tools to explore all the HTML form elements in your CF7 form and see how each element is being styled in detail by the CSS in your current WordPress theme.
In particular take note of the various style sheets that are contributing to the final style used and how individual style elements are being overwritten (or not) by the CSS hierarchy.
Once you understand how the HTML and CSS is configured in your CF7 form, you can begin to plan the CSS changes you need to change the appearance of the form to suit your requirements.
You will need to be skilled at using Firebug or Chrome Dev Tools to examine the HTML and CSS of your CF7 form in detail to follow along in this article.
If that description does not fit you, you can learn about Firebug or Chrome Dev Tools and come back to this article when you’ve done that..
CF7 Form Structure
We used Firebug to produce the following diagram which shows the overall structure if the default CF7 form we are using in this article.
Click on image to open larger version
The diagram shows how each element of the form is created using standard HTML form elements and how those elements are arranged in relation to each other.
With experience, using Firebug or Chrome Dev Tools should give you all the information you need to change the style of your CF7 forms quickly and easily, but it may definitely help you initially to produce a hand drawn paper sketch similar to this diagram.
CSS
Default CF7 CSS style
There is a common misconception that the CF7 plugin controls the appearance of CF7 forms though the plugins CSS style sheets.
In truth the Contact Form 7 plugin uses only very minimal CSS styling to allow CF7 forms to blend in with most websites. For a listing of complete style sheet used by the CF7 plugin see Default CF7 CSS style.
The appearance of CF7 forms on your website will depend largely on the current WordPress theme used and the CSS styling that theme applies to standard HTML form elements.
Examine CSS in your current WordPress theme
The actual look of CF7 forms on your website will depend largely on the current WordPress theme used and the CSS styling that theme applies to standard HTML form elements.
To change the appearance of your CF7 forms to suit your requirements, you will need to:
- Understand what CSS styling is being applied to standard HTML form elements in your CF7 form
- Adjust the CSS used by your current theme for these HTML form elements.
Your current theme may not do a good job of styling forms
For some reason many WordPress themes do not provide CSS styling for standard HTML form elements. We regard this as poor practice and always look closely at how a theme styles standard HTML form elements when selecting themes.
Importantly if your theme neglects to provide appropriate CSS for these standard HTML form elements then the appearance of your form will fall back to that provided by default by the browser – which can be different in different browsers.
Use a Child Theme to make changes to your CF7 forms CSS
The most common and preferred method to makes changes to CF7 form styling is to create a Child Theme.
Make any necessary additions to the CSS in the child themes style.css only, rather than directly in the themes styles.css. That way you don’t lose your changes when you update the theme.
The style.css file of the child theme usually imports all styling from the parent theme by including the following CSS code at the top of the child theme’s style.css file.
/* Import Parent Theme */ @import url('../twentyeleven/style.css');
Any CSS changes that alter the appearance of our CF7 forms are added below this. Due to the CSS loading heirachy, any CSS changes made here will overwrite styles previously set in the parent theme.
Alternatively you could use a custom CSS plugin to make your CSS changes.
Target CSS changes to CF7 forms only
When making CSS changes you want to make sure that your CSS changes don’t inadvertantly effect other elements on your website.
The preferred way to do this is to use CSS inheritance to target the relevant HTML elements within your CF7 forms only.
For CF7 forms we have several ids & classes which can be used to give the necessary targeted inheritance including:
- .wpcf7
- .wpcf7-form
- .wpcf7-form-control
For example we can use the class .wpcf7-form to change the appearance of all HTML input text elements within CF7 forms only:
.wpcf7-form input[type="text"] { background: #fff; border: 1px solid #bbb; color: #4F4F4F; }
Use CSS inheritance to ensure that your CSS changes don’t inadvertently affect other elements on your website.
You made need higher CSS Specificity
Depending on how your theme styles standard HTML form elements in general, and CF7 form elements in particular, you may need to add extra CSS specificity to get your CSS changes showing.
For example we can use an extra the CF7 class to give higher CSS Specificity:
.wpcf7 .wpcf7-form input[type="text"] { background: #fff; border: 1px solid #bbb; color: #4F4F4F; }
For WordPress themes with high levels of unnecessary CSS specificity, you may need to target the #id of specfic CF7 forms as explained in Styling a Specific Contact Form 7 Form.
Add CSS changes on individual CF7 form elements
You can add additional CSS styling to any CF7 form elements you want to modify.
The list of common elements that can be targeted within CF7 forms include:
- .wpcf7 input
- .wpcf7 input[type=”text”]
- .wpcf7 input[type=”email”]
- .wpcf7 input[type=”checkbox”]
- .wpcf7 textarea
- .wpcf7 select
- .wpcf7 select option
- .wpcf7 select option:hover
- .wpcf7 p
You can use Firebug or Chrome Dev Tools to explore the full range of ids & classes used by Contact Form 7.
For example to change the background colour of the Send button when the mouse pointer hovers over the button:
.wpcf7 input[type="submit"]:hover { background:#4f2a0f; cursor:pointer; color:#fff; }
There are some CF7 classes available which you might want to use to target a specific CF7 Tag on all CF7 forms on your site.
- .wpcf7-text
- .wpcf7-email
- .wpcf7-textarea
- .wpcf7-submit
Copy current CSS with your Dev Tool
Often you can copy the CSS currently used on the element from within your Dev Tool
and then add alternative values for the properties you want to change.
Add CF7 classes & ids within your CF7 forms
You can also add id and class attributes to a CF7 form by adding html_id and html_class attributes into a CF7 shortcode. This can be used to target individual forms via the html_id attribute or a number of forms using the html_class attribute.
HTML:
[ contact-form-7 id=”1511″ html_class=”cf7-psForm” title=”Personal Service Form” ]
CSS:
.wpcf7 .cf7-psForm { background: none repeat scroll 0 0 #fff; border: 1px solid #9ffffe; padding: 20px; }
Use CSS to change the appearance of your CF7 form
Using the techniques described in this article, we can use the following CSS to change the appearance of the default CF7 form.
.wpcf7-form { background: #dcc8a5; padding: 10px 20px; border: 2px solid #f6efdf; border-radius: 7px; width: 300px; } .wpcf7-form p { color: #4f2a0f; margin-bottom: 5px; } .wpcf7-form input, .wpcf7-form textarea { background: #f6efdf; padding: 5px 7px; margin: 4px 0 8px 0; border: 3px solid #ccb58c; color: #4f4f4f; border-radius: 7px; } .wpcf7-form .wpcf7-submit { background: #4f2a0f; padding: 5px 15px; color: #fff; min-width: 100px; } .wpcf7-form input[type="submit"]:hover { background: #000; } |
Using the changed CSS given above, the default CF7 form now looks as shown below.
As practice you can use Firebug or Chrome Dev Tools to see how we’ve styled this form.
Targeting Specific CF7 Forms
Each CF7 form has a unique id which can be targeted in your CSS changes – see Styling a Specific Contact Form 7 Form for detailed instructions on how to do this.
Contact Form 7 Styling Troubleshooter
If you would like some help from our support staff & are willing to help us by providing information on your use of Contact Form 7 & CF7 Skins, you should complete the following form:
This form is made with CF7 Skins + CF7 Skins Pro + CF7 Skins Ready + CF7 Skins Multi + CF7 Skins Logic
Still have questions?
If you still have questions, after reading and working through the information provided in this article, you should ask your question in the CF7 support forum.
Please include:
- a link to your Contact Form 7 form plus
- all your input in the Form & Mail sections of the CF7 interface.
This helps others to understand your actual problem and offer a possible solution.
Tip: Make sure you create a separate post for your question as per the WordPress Forum Guidelines.
This page is still a Work in Progress
This article was created from questions asked in the CF7 support forum related to this issue. We add more information as we become aware of other issues and solutions.
If you have something you think might help others on this issue, you can use the CF7 form below to contact us.
Please note that anything that looks like a request for support or help will probably be ignored.
This form is made using CF7 Skins – you can use Firebug or Chrome Dev Tools to see how we’ve built it.