Home / Admin / Centering All Form Elements
Duplicate Snippet

Embed Snippet on Your Site

Centering All Form Elements

This CSS snippet will center everything inside the form (labels, descriptions, buttons).

10+
Code Preview
css
/* Center the form container */
.wpforms-container.wpf-center {
    margin: 0 auto !important;
    max-width: 500px !important;
    width: 500px !important;
}
/* Center submit button and make it full width */
.wpf-center .wpforms-submit-container {
    display: inline-block;
    text-align: center;
    width: 100% !important;
}
/* Center page break elements */
.wpf-center .wpforms-field-pagebreak {
    display: inline-block;
    text-align: center;
    width: 100% !important;
}
/* Remove default page break button decorations */
.wpf-center .wpforms-pagebreak-left .wpforms-page-button:before,
.wpf-center .wpforms-pagebreak-left .wpforms-page-button:after {
    content: none;
}
/* Center all text elements */
.wpf-center .wpforms-title,
.wpf-center .wpforms-description,
.wpf-center .wpforms-field-label,
.wpf-center .wpforms-field-sublabel,
.wpf-center .wpforms-field-description {
    text-align: center;
}
/* Mobile responsiveness */
@media only screen and (max-width: 600px) {
    .wpforms-container.wpf-center {
        max-width: unset !important;
        width: auto !important;
    }
}

Comments

Add a Comment