10 Contact Form 7 Styling Examples For A Beautiful Website

Photo of author
Written By Charlie Giles

Devoted WordPress fan behind CodeCraftWP. Sharing years of web expertise to empower your WordPress journey!

Disclosure: This post may contain affiliate links, which means if you click on a link and make a purchase, I may earn a commission at no additional cost to you.

In this article, we’ll show you how to style your Contact Form 7 in 10 different ways. From basic styling to advanced techniques, you’ll learn how to customize font, color, layout, and more to create a beautiful form that matches your website.

Basic Styling of Contact Form 7

If you’re using Contact Form 7 on your website, you may want to customize the look and feel of your forms to match your branding or improve the user experience. Fortunately, Contact Form 7 offers several options for basic styling, such as changing font size and style, adjusting text and background colors, and adding custom CSS.

Changing Font Size and Style

To change the font size and style of your form fields, you’ll need to add some CSS to your website. You can either add custom CSS to your theme’s stylesheet or add it directly to the Contact Form 7 form editor.

Here’s an example of how to change the font size and style of your form fields using custom CSS:

.wpcf7-form-control {
font-size: 16px;
font-family: Arial, sans-serif;
}

In this example, we’re targeting the .wpcf7-form-control class, which applies to all form fields in Contact Form 7. We’re setting the font size to 16 pixels and the font family to Arial, sans-serif. You can adjust these values to match your preferences.

Adjusting Text and Background Colors

To adjust the text and background colors of your form fields, you can use CSS again. Here’s an example of how to change the text and background color of your form fields:

.wpcf7-form-control {
color: #333;
background-color: #f5f5f5;
}

In this example, we’re setting the text color to a dark gray (#333) and the background color to a light gray (#f5f5f5). You can choose any you like by using a color picker tool or by specifying the hex code for the color.

Adding Custom CSS

If you want to go beyond basic styling options, you can add custom CSS to your Contact Form 7 forms. Custom CSS allows you to add more complex styling, such as hover effects, animations, and advanced layouts.

To add custom CSS to your Contact Form 7 forms, go to the form editor and click on the “Additional Settings” tab. Then, add your CSS code in the text field:

<style>
/* Your custom CSS code goes here */
</style>

You can use any CSS selector and property to style your form fields. Just make sure that your CSS code doesn’t conflict with other CSS on your website.


Styling Form Elements

When it comes to styling your contact form, there are a variety of elements that you can customize to make it match your website’s branding and design. In this section, we’ll cover how to change the style of your input fields, dropdown menus, and submit button.

Changing Input Field Style

The input fields on your contact form are where users will enter their information, so it’s important to make them visually appealing and easy to use. To change the style of your input fields in Contact Form 7, you can use custom CSS.

First, you’ll need to identify the CSS class for your input fields. You can do this by inspecting the element in your web browser, or by using a plugin like “What The File” to view the Contact Form 7 template.

Once you have the CSS class, you can use CSS properties like “border”, “background-color“, and “font-size” to customize the appearance of your input fields. For example, you could add a border and background color to make the fields stand out:

.wpcf7-text {
border: 2px solid #ccc;
background-: #f9f9f9;
font-size: 16px;
}

Styling Dropdown Menus

Dropdown menus are a common element on contact forms, allowing users to select from a list of options. To style your dropdown menus in Contact Form 7, you can use the same CSS classes as your input fields.

One common customization is to change the of the dropdown arrow. This can be done using the “background-image” property, like so:

.wpcf7-select {
background-image: url('path/to/arrow.png');
background-position: right center;
background-repeat: no-repeat;
}

You can also adjust the font size and color of the dropdown options using the “font-size” and “color” properties.

Customizing Submit Button

The submit button is the final element on your contact form, and it’s important to make it clear and easy to use. To customize the submit button in Contact Form 7, you can use CSS to adjust the button’s background color, font size, and more.

First, identify the CSS class for your submit button. This will typically be “.wpcf7-submit” or “.wpcf7-form-control.wpcf7-submit”. Then, you can use properties like “background-color”, “font-size”, and “padding” to style the button. For example:

.wpcf7-submit {
background-: #2ecc71;
color: #fff;
font-size: 18px;
padding: 10px 20px;
border-radius: 5px;
}

In addition to these basic customizations, you can also add hover effects, animations, and more to your submit button using CSS.

Overall, styling your contact form’s elements can help create a cohesive and professional look for your website. By customizing your input fields, dropdown menus, and submit button, you can make your contact form stand out and encourage users to fill it out.


Advanced Styling Techniques

Styling contact forms can be a challenging task that requires a lot of creativity and technical expertise. While the basic styling options available in Contact Form 7 are sufficient for most users, some advanced techniques can take your forms to the next level.

Creating Multi-column Forms

One of the most effective ways to improve the layout and design of your contact forms is by creating multi-column forms. This technique involves dividing the form into multiple columns, making it more visually appealing and easier to complete.

To create a multi-column form in Contact Form 7, you will need to use HTML and CSS. Here is an example code snippet that you can use:

<div class="row">
<div class="column">
[text* your-name placeholder "Your Name"]
</div>
<div class="column">
[email* your-email placeholder "Your Email"]
</div>
</div>

The above code creates a simple two-column form with two input fields for name and email. You can adjust the width of the columns by changing the CSS class styles.

Adding Background Images

Adding background images to your contact forms is another advanced styling technique that can enhance the overall design and aesthetic appeal. The background image can be used to create a unique visual identity for your forms, making them more memorable and engaging.

To add a background image to your Contact Form 7, you can use the following CSS code:

.wpcf7-form {
background-image: url('your-image-url');
background-repeat: no-repeat;
background-size: cover;
}

Make sure to replace ‘your-image-url’ with the actual URL of your image file. You can adjust the size and repeat properties to your liking.

Using Custom Fonts

Using custom fonts is an excellent way to make your contact forms stand out and match your brand’s typography. Custom fonts can also improve readability and make the form more aesthetically pleasing.

To use custom fonts in Contact Form 7, you will need to add the CSS code to your WordPress theme’s stylesheet or use a plugin that allows you to add custom CSS. Here is an example of how to use Google Fonts in your form:

@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700&amp;display=swap');
.wpcf7-form label {
font-family: 'Open Sans', sans-serif;
font-weight: 700;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
font-family: 'Open Sans', sans-serif;
font-weight: 400;
}

The above code imports the Google Font ‘Open Sans’ and applies it to the label, input, and textarea elements in your form. You can adjust the font family and weight properties to your liking.


Responsive Styling

As more and more people access the internet using mobile devices, it’s essential that your contact form is mobile-friendly. Responsive styling ensures that your form looks good and functions well, regardless of the device being used.

Making Forms Mobile-friendly

To make your contact form mobile-friendly, you need to ensure that it’s easy to use and navigate on a smaller screen. Consider the following tips:

  • Use a responsive design: A responsive design will automatically adjust your form to fit the screen size of the device being used.
  • Simplify your form: Mobile users don’t want to fill out a long and complicated form. Keep your form short and only ask for essential information.
  • Use clear and concise language: Use language that’s easy to understand and avoid using technical jargon.

Adapting to Different Screen Sizes

Your contact form needs to be adaptable to different screen sizes. This means that it needs to be easily readable and functional on both small and large screens. Consider the following tips:

  • Use a flexible layout: A flexible layout will adjust your form to fit different screen sizes.
  • Use appropriate font sizes: Ensure that your font sizes are legible on both small and large screens.
  • Use clear and concise labels: Use labels that are easy to read and understand.

Adjusting Form Layout for Tablets and Phones

Tablets and phones have different screen sizes, which means that your contact form needs to be optimized for both. Consider the following tips:

  • Use a separate layout for tablets: Tablets have larger screens than phones, so you can include more fields in your form. Use a separate layout for tablets to take advantage of this.
  • Use a single column layout for phones: Phones have smaller screens, so it’s best to use a single column layout for your form.
  • Use a clear and concise layout: Your layout should be easy to navigate and use, regardless of the device being used.

Troubleshooting Common Styling Issues

Web development can be difficult at times, especially when it comes to styling issues. If you’re having trouble with your Contact Form 7 plugin, there are some common styling issues that you might run into. In this section, we’ll discuss some of the most common styling issues and how to troubleshoot them.

Fixing Alignment Problems

Alignment problems are one of the most common styling issues that users experience with Contact Form 7. This can be frustrating, as it can make your form look unprofessional and unappealing to potential customers. Fortunately, there are a few ways to fix alignment problems.

One way to fix alignment problems is to use CSS. You can adjust the margins and padding of your form elements to ensure that they are properly aligned. If you’re not familiar with CSS, there are many online resources that can help you learn the basics.

Another way to fix alignment problems is to use a table. You can use a table to ensure that your form elements are properly aligned. Here is an example of how you can use a table to fix alignment problems:

Label Input Field
Name: [text* your-name]
Email: [email* your-email]
Subject: [text your-subject]
Message: [textarea your-message]

By using a table, you can ensure that your form elements are properly aligned, making your form look more professional.

Resolving Styling Conflicts with Other Plugins

Another common issue that users experience with Contact Form 7 is styling conflicts with other plugins. This can be frustrating, as it can cause your form to look different than how you intended it to look. Fortunately, there are a few ways to resolve styling conflicts.

One way to resolve styling conflicts is to use CSS specificity. CSS specificity is a way of targeting specific elements on your page. By using CSS specificity, you can ensure that your styling is applied to your Contact Form 7 plugin, regardless of any conflicts with other plugins.

Another way to resolve styling conflicts is to use the !important rule. The !important rule tells the browser to prioritize a specific CSS rule over any other conflicting rules. Here is an example of how you can use the !important rule to resolve a styling conflict:

input[type=”text”] {
border: 1px solid #000 !important;
}

By using the !important rule, you can ensure that your styling is applied to your Contact Form 7 plugin, regardless of any conflicts with other plugins.

Troubleshooting Browser Compatibility Issues

Browser compatibility issues are another common issue that users experience with Contact Form 7. This can be frustrating, as it can cause your form to look different on different browsers. Fortunately, there are a few ways to troubleshoot browser compatibility issues.

One way to troubleshoot browser compatibility issues is to use browser-specific CSS. By using browser-specific CSS, you can ensure that your form looks the same on all browsers. Here is an example of how you can use browser-specific CSS to troubleshoot browser compatibility issues:

/ Chrome and Safari /
@media screen and (-webkit-min-device-pixel-ratio:0) {
input[type=”text”] {
border: 1px solid #000;
}
}

/ Firefox /
@-moz-document url-prefix() {
input[type=”text”] {
border: 1px solid #000;
}
}

By using browser-specific CSS, you can ensure that your form looks the same on all browsers, regardless of any compatibility issues.

In conclusion, styling issues can be frustrating, but there are ways to troubleshoot them. By following the tips outlined in this section, you can fix alignment problems, resolve styling conflicts with other plugins, and troubleshoot browser compatibility issues. With these troubleshooting techniques, you can ensure that your Contact Form 7 plugin looks professional and functions properly.

Leave a Comment