Style ContactForm7 entry fields like in the Divi Theme contact form

Divi builder, by Elegant Themes, is surely one of the most powerful and robust drag-and-drop site builders for WordPress. Trouble is, the built in contact form module is not very powerful or flexible.

Thus, I like to fall back on the proven (and extensible) ContactForm7 plugin for contact/inquiry forms, which offers everything I need and more. If only it would look the same as the rest of the Divi theme.

I’ve found this article on AgentWP: How To Make Contact Form 7 To Look Like Divi Contact Form Module, which I used as a base, and added some more fields for checkboxes, date-pickers etc..

.wpcf7-text, .wpcf7-textarea, .wpcf7-captchar, .wpcf7-date {
background-color: #eee !important;
border: none !important;
width: 100% !important;
-moz-border-radius: 0 !important;
-webkit-border-radius: 0 !important;
border-radius: 3px !important;
font-size: 20px;
color: #333 !important;
padding: 16px !important;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.wpcf7-submit {
color: #fff !important;
margin: 8px auto 0;
cursor: pointer;
font-size: 20px;
font-weight: 500;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
padding: 6px 20px;
line-height: 1.7em;
background: transparent;
border: 2px solid;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-moz-transition: all 0.2s;
-webkit-transition: all 0.2s;
transition: all 0.2s;
}
.wpcf7-submit:hover {
background-color: rgba(255,255,255,0.5);
border-color:rgba(255,255,255,0.3);
padding: 6px 20px !important;
}

This just leaves the issue of things not lining out properly, which I solved (ouch) with a table in the form, which I give the

nofancy

class, and after adding the below CSS this blends in nicely as well.


table.nofancy {
border: none;
}

table.nofancy td {
border: none;
padding: 10px 0px;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.