In this article we’re taking a look at how to style the Contact Form 7 Submit button when hovering over it.
By styling the button during the mouse over you can improve the user experience and guide users to click the button and submit the contact form.
This may be for the purpose of getting a quote, general enquiries or a tonne of other great uses for the contact form.
Before we delve into the code during this tutorial we will be using CSS to style the button, if you’re unfamiliar with how to add CSS to WordPress take a look at our article here.
The Code to Set the Hover Styles:
So let’s get started with the CSS code. As long as your installation of Contact Form 7 is standard and your theme styling isn’t overriding it by default you should be using the classes:
.wpcf7-form-control.wpcf7-submit
So to style this we simply add :hover to the end of the class and add our CSS, this would like this:
.wpcf7-form-control.wpcf7-submit:hover {
background: black;
border: 5px solid pink;
color: pink;
}
In the above example we are setting the button to have a black background with a 5px solid pink border and a text colour of pink when hovered over. You can style the button however you want to suit your site some good ideas for styling options include:
Border-Radius: 25px; – This sets a curved border of 25px.
Font-size: 150%; – This increases the font size to 150% of the original font size.
Text-transform: Uppercase; – This sets the font to be uppercase when hovered over.
Width: 150%; – This increases the width of the button when hovered over.
Summary:
There are tonnes of examples just like this that will allow you to create a really nice user experience and to match the existing design / style of your overall site and brand.
We hope you found this useful, if you did we would really appreciate a comment or any shares thanks!








