Skip to main content

Basic Floating Labels

The Basic Floating Labels template is intended to be a neatly styled basic formatting template that is plug-and-play and doesn't require any frameworks or toolkits, etc. It displays labels in the center of the inputs and shrinks them to the top-right when clicked and/or contains a value. This formatting template is ready-to-go on "light" pages and does not require any additional styling unless you wish to do so. You can place the CSS and JS inside the formatting template or add to your site's CSS / JS files.

Video: Preview of Formatting Template Examples

Formatting

{# Opening <form> tag #}
{{ form.renderTag({
instructionsBelowField: true
}) }}

{# Display Success or Error banner and general errors if applicable #}
<div id="freeform-success-error-banner">
{% if not form.ajaxEnabled and form.submittedSuccessfully %}
<div class="freeform-form-success">
<p>{{ form.successMessage | t('freeform') }}</p>
</div>
{% endif %}

{% if form.hasErrors %}
<div class="freeform-form-errors">
<p>{{ form.errorMessage | t('freeform') }}</p>

{% if form.errors|length %}
<ul>
{% for error in form.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
</div>

{# Render page tabs if multi-page #}
{% if form.pages|length > 1 %}
<ul class="freeform-pages">
{% for page in form.pages %}
<li {% if form.currentPage.index == page.index %}class="active"{% endif %}>
{{ page.label }}
</li>
{% endfor %}
</ul>
{% endif %}

{# Render form fields #}
{% for row in form %}
<div class="freeform-row {{ form.customAttributes.rowClass }}">
{% for field in row %}
{% set width = (12 / (row|length)) %}
{% set columnClass = "freeform-col-" ~ width %}
{% set columnClass = columnClass ~ form.customAttributes.columnClass %}
{% if field.type == "submit" or field.type == "save" %}
{% set columnClass = columnClass ~ " freeform-column-content-align-" ~ field.position %}
{% endif %}
<div class="{{ columnClass }} freeform-fieldtype-{{ field.type }}{% if field.type in ["text", "textarea", "email", "website", "confirmation", "regex", "phone", "datetime", "file", "select", "multiple_select", "number", "password", "file_drag_and_drop", "signature", "cc_details"] or (field.type == "dynamic_recipients" and (field.showAsSelect)) %} floating{% endif %}"{{ field.rulesHtmlData }}>
{% if field.type in ["text", "textarea", "email", "website", "confirmation", "regex", "phone", "datetime", "number", "password", "checkbox", "mailing_list"] %}
{% if field.type in ["checkbox", "mailing_list"] %}
{% set fieldPlaceholder = "" %}
{% else %}
{% set fieldPlaceholder = (field.placeholder ? field.placeholder : " ") %}
{% endif %}
{{ field.renderInput({ class: "freeform-input" ~ (field.hasErrors ? " is-invalid"), placeholder: fieldPlaceholder }) -}}
{{- field.renderLabel({ labelClass: "freeform-label" ~ (field.required ? " freeform-required" : "") }) }}
{{ field.renderInstructions({ instructionsClass: "freeform-instructions" }) }}
{{ field.renderErrors({ errorClass: "freeform-errors" }) }}
{% else %}
{{ field.render({
class: field.type not in ["submit", "save", "signature"] ? "freeform-input" : "",
labelClass: "freeform-label" ~ (field.inputOnly ? " freeform-input-only-label" : "") ~ (field.required ? " freeform-required" : ""),
errorClass: "freeform-errors",
instructionsClass: "freeform-instructions",
}) }}
{# FOR FREEFORM PAYMENTS #}
{% if field.layoutRows is defined %}
{% for layoutRow in field.layoutRows %}
<div class="freeform-row freeform-payments {{ form.customAttributes.rowClass }}">
{% for layoutField in layoutRow %}
{% set layoutWidth = (12 / (layoutRow|length)) %}
{% set paymentColumnClass = "freeform-col-" ~ layoutWidth %}
<div class="{{ paymentColumnClass }}">
{{ layoutField.render({
class: "freeform-input",
labelClass: "freeform-label" ~ (layoutField.inputOnly ? " freeform-input-only-label" : "") ~ (layoutField.required ? " freeform-required" : ""),
errorClass: "freeform-errors",
instructionsClass: "freeform-instructions",
}) }}
</div>
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% endif %}

</div>
{% endfor %}
</div>
{% endfor %}

{# Closing </form> tag #}
{{ form.renderClosingTag }}

CSS

The following CSS is a supplemental starting point to get forms appearing robustly.

/* LAYOUT */
.freeform-form-container {
font-family: sans-serif;
}
.freeform-row::after {
content: '';
clear: both;
display: block;
}
[class*='freeform-col-'] {
float: left;
padding: 15px;
}

/* BUTTONS */
button {
font: 400 18px sans-serif;
line-height: 1.5;
color: #ffffff;
text-align: center;
text-decoration: none;
border: 1px solid #0d6efd;
border-radius: 5px;
background-color: #0d6efd;
padding: 5px 15px;
margin-right: 10px;
cursor: pointer;
display: inline-block;
vertical-align: middle;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out;
justify-content: center;
}
button:only-child,
button:last-child {
margin-right: 0;
}
button:hover {
color: #ffffff;
background-color: #0b5ed7;
border-color: #0a58ca;
}
button[data-freeform-action='back'] {
font: 400 18px sans-serif;
color: #6c757d;
background-color: transparent;
border-color: #6c757d;
}
button[data-freeform-action='back']:hover {
color: #ffffff;
background-color: #6c757d;
border-color: #6c757d;
}
button[type='submit'].ff-loading {
display: inline-flex;
flex-wrap: nowrap;
align-items: center;
}
button[type='submit'].ff-loading:before {
content: '';
display: block;
flex: 1 0 11px;
width: 11px;
height: 11px;
margin-right: 10px;
border-style: solid;
border-width: 2px;
border-color: transparent transparent #fff #fff;
border-radius: 50%;
animation: ff-loading 0.5s linear infinite;
}
@keyframes ff-loading {
0% {
transform: rotate(0);
}
100% {
transform: rotate(1turn);
}
}

/* PAGE TABS */
.freeform-pages {
display: flex;
padding: 0;
margin: 0 0 25px 0;
list-style: none;
border-bottom: 2px solid #dddddd;
}
.freeform-pages li {
color: #6c757d;
background: transparent;
padding: 10px 20px;
margin: 0;
}
.freeform-pages li.active {
color: black;
font-weight: bold;
background: #dddddd;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

/* FORM LAYOUT */
.freeform-row {
font: normal 16px sans-serif;
color: #464747;
justify-content: space-between;
padding: 0;
margin: 0;
}
.freeform-row [class*='freeform-col-'] {
flex: 1 0;
padding: 10px;
margin: 0;
box-sizing: border-box;
}
.freeform-row [class*='freeform-col-'] > .freeform-row:first-child {
margin-top: -10px;
}
.freeform-row [class*='freeform-col-'] label {
display: block;
margin: 0 0 5px 0;
}

.freeform-row [class*='freeform-col-'] .freeform-input[type='checkbox'],
.freeform-row [class*='freeform-col-'] .freeform-input[type='radio'] {
margin-right: 10px;
width: auto;
display: inline;
transform: scale(1.15);
}
.freeform-row
[class*='freeform-col-']
label:has(> .freeform-input[type='checkbox'].freeform-has-errors),
.freeform-row
[class*='freeform-col-']
label:has(> .freeform-input[type='radio'].freeform-has-errors),
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox_group:has(
ul.freeform-errors
)
label:not(:first-child),
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox_group:has(
ul.freeform-errors
)
div.input-group-one-line
label,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-radio_group:has(
ul.freeform-errors
)
label:not(:first-child),
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-radio_group:has(
ul.freeform-errors
)
div.input-group-one-line
label {
color: #dc3545 !important;
}

.freeform-row [class*='freeform-col-'] .input-group-one-line {
display: flex;
flex-wrap: wrap;
}
.freeform-row [class*='freeform-col-'] .input-group-one-line label {
padding-right: 15px;
}
.freeform-row
[class*='freeform-col-']
.input-group-one-line
label
input[type='radio'],
.freeform-row
[class*='freeform-col-']
.input-group-one-line
label
input[type='checkbox'] {
margin-right: 10px;
display: inline-block;
transform: scale(1.15);
}
.freeform-row [class*='freeform-col-'] .freeform-label {
font-weight: 400;
}
.freeform-row [class*='freeform-col-'] .freeform-label.freeform-required:after {
content: '*';
margin-left: 5px;
color: #dc3545;
}
.freeform-row.freeform-payments {
margin: -10px;
}

/* FLOATING LABELS */
.freeform-row [class*='freeform-col-'].floating,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-cc_details.floating
> div
> div {
display: block;
position: relative;
}
.freeform-row [class*='freeform-col-'].floating label {
position: absolute;
left: 20px;
top: 16px;
cursor: text;
font: normal 13px sans-serif;
color: #212529;
background: #ffffff;
opacity: 0.7;
transition: all 0.5s;
}
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-file_drag_and_drop.floating
label,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-signature.floating
label {
top: 18px;
background: transparent;
z-index: 10;
}
.freeform-row [class*='freeform-col-'].floating input,
.freeform-row [class*='freeform-col-'].floating .StripeElement,
.freeform-row [class*='freeform-col-'].floating textarea,
.freeform-row [class*='freeform-col-'].floating select {
color: #212529 !important;
font: normal 16px sans-serif;
}

.freeform-row [class*='freeform-col-'].floating input::placeholder,
.freeform-row [class*='freeform-col-'].floating textarea::placeholder,
.freeform-row [class*='freeform-col-'].floating select::placeholder {
opacity: 1;
transition: all 0.5s;
}
.freeform-row
[class*='freeform-col-'].floating
input:placeholder-shown:not(:focus)::placeholder,
.freeform-row
[class*='freeform-col-'].floating
textarea:placeholder-shown:not(:focus)::placeholder,
.freeform-row
[class*='freeform-col-'].floating
select:placeholder-shown:not(:focus)::placeholder {
opacity: 0;
}
.freeform-row
[class*='freeform-col-'].floating
input:placeholder-shown:not(:focus)
+ *,
.freeform-row
[class*='freeform-col-'].floating
textarea:placeholder-shown:not(:focus)
+ *,
.freeform-row
[class*='freeform-col-'].floating
select:placeholder-shown:not(:focus)
+ * {
font: normal 16px sans-serif;
color: #212529 !important;
opacity: 0.9;
top: 29px;
left: 28px;
}
.freeform-row [class*='freeform-col-'].floating input:focus,
.freeform-row [class*='freeform-col-'].floating textarea:focus,
.freeform-row [class*='freeform-col-'].floating select:focus {
border: 1px solid #0b5ed7 !important;
outline: 0;
}
.freeform-row [class*='freeform-col-'].floating input::placeholder,
.freeform-row [class*='freeform-col-'].floating .StripeElement--placeholder,
.freeform-row [class*='freeform-col-'].floating textarea::placeholder,
.freeform-row [class*='freeform-col-'].floating select::placeholder {
opacity: 1;
transition: all 0.5s;
font-size: inherit;
}
.freeform-row
[class*='freeform-col-'].floating
input:placeholder-shown:not(:focus)::placeholder,
.freeform-row
[class*='freeform-col-'].floating
textarea:placeholder-shown:not(:focus)::placeholder,
.freeform-row
[class*='freeform-col-'].floating
select:placeholder-shown:not(:focus)::placeholder {
opacity: 0;
font-size: inherit;
padding-top: 1em;
margin-bottom: 2px;
}
.freeform-row
[class*='freeform-col-'].floating
input::placeholder-shown:not(:focus)
+ *,
.freeform-row
[class*='freeform-col-'].floating
textarea::placeholder-shown:not(:focus)
+ *,
.freeform-row
[class*='freeform-col-'].floating
select::placeholder-shown:not(:focus)
+ * {
font: normal 12px sans-serif;
opacity: 0.5;
top: 4px;
}
.freeform-row [class*='freeform-col-'].floating input:focus,
.freeform-row [class*='freeform-col-'].floating textarea:focus,
.freeform-row [class*='freeform-col-'].floating select:focus {
outline: none;
border: 1px solid #cbced0;
}

/* BASIC FIELD STYLES */
.freeform-row [class*='freeform-col-'] input,
.freeform-row [class*='freeform-col-'] .freeform-input.StripeElement,
.freeform-row [class*='freeform-col-'] textarea,
.freeform-row [class*='freeform-col-'] select {
box-sizing: border-box;
font: normal 16px sans-serif;
color: #212529;
background-color: #ffffff;
border: 1px solid #cbced0;
border-radius: 5px;
padding: 25px 10px 10px 10px;
width: 100%;
display: block;
resize: none;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out;
}
.freeform-row [class*='freeform-col-'] select:not(select[multiple]) {
background-image: linear-gradient(45deg, transparent 50%, #6c757d 50%),
linear-gradient(135deg, #6c757d 50%, transparent 50%), linear-gradient(to
right, #6c757d, #6c757d);
background-position: calc(100% - 20px) calc(1em + 8px), calc(100% - 15px) calc(
1em + 8px
), calc(100% - 2.5em) 0.5em;
background-size: 5px 5px, 5px 5px, 1px 35px;
background-repeat: no-repeat;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
}
.freeform-row [class*='freeform-col-'] input:focus,
.freeform-row [class*='freeform-col-'] .freeform-input.StripeElement--focus,
.freeform-row [class*='freeform-col-'] textarea:focus,
.freeform-row [class*='freeform-col-'] select:focus {
border: 1px solid #0b5ed7;
outline: 0;
transition: border-color 0.15s ease-in-out;
}
.freeform-row [class*='freeform-col-'] input::placeholder,
.freeform-row [class*='freeform-col-'] textarea::placeholder {
font: normal 16px sans-serif;
color: #abb5be;
}
.freeform-row [class*='freeform-col-'] input.freeform-has-errors,
.freeform-row [class*='freeform-col-'] .freeform-input.StripeElement--invalid,
.freeform-row [class*='freeform-col-'] textarea.freeform-has-errors,
.freeform-row [class*='freeform-col-'] select.freeform-has-errors,
.freeform-row [class*='freeform-col-'] input:has(+ ul.freeform-errors),
.freeform-row [class*='freeform-col-'] textarea:has(+ ul.freeform-errors),
.freeform-row [class*='freeform-col-'] select:has(+ ul.freeform-errors) {
border: 1px solid #dc3545;
}

.freeform-row [class*='freeform-col-'] .freeform-input-only-label {
font-weight: normal;
}
.freeform-row
[class*='freeform-col-']
.freeform-input-only-label
> .freeform-input {
display: inline-block;
width: auto;
margin-right: 10px;
}
.freeform-row [class*='freeform-col-'] .freeform-errors,
.freeform-row [class*='freeform-col-'] .ff-errors {
margin: -5px 0 0 0;
padding: 0;
list-style: none;
display: block;
width: 100%;
}
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-radio_group
.freeform-errors,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-radio_group
.ff-errors,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox_group
.freeform-errors,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox_group
.ff-errors {
margin-top: 0;
}
.freeform-row [class*='freeform-col-'] .freeform-errors > li,
.freeform-row [class*='freeform-col-'] .ff-errors > li {
font: italic 400 15px sans-serif;
color: #dc3545;
margin-top: 10px;
}
.freeform-row [class*='freeform-col-'] .freeform-errors > li:not(:first-child),
.freeform-row [class*='freeform-col-'] .ff-errors > li:not(:first-child) {
margin-top: 3px;
}
.freeform-row [class*='freeform-col-'] .freeform-instructions {
font-size: 13px;
color: #969696;
margin: 5px 0 10px 0;
}
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox
.freeform-instructions {
margin-top: -5px;
}

/* SINGLE CHECKBOX FIELDS */
.freeform-row [class*='freeform-col-'].freeform-fieldtype-checkbox label,
.freeform-row [class*='freeform-col-'].freeform-fieldtype-mailing_list label {
display: inline-block;
margin: 0 0 10px 0;
}
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox
input[type='checkbox'],
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-mailing_list
input[type='checkbox'] {
margin-right: 10px;
width: auto;
display: inline-block;
transform: scale(1.15);
}
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox
input.freeform-has-errors
+ label,
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox
label:has(+ ul.freeform-errors),
.freeform-row
[class*='freeform-col-'].freeform-fieldtype-checkbox
label:has(+ div + ul.freeform-errors) {
color: #dc3545 !important;
}

/* OPINION SCALE FIELDS */
.freeform-fieldtype-opinion_scale .opinion-scale-scales {
border: 1px solid #cbced0;
border-radius: 5px;
}
.freeform-fieldtype-opinion_scale .opinion-scale-scales li label {
color: #464747 !important;
background-color: #ffffff;
border: 0;
border-left: 1px solid #cbced0;
padding: 10px 15px;
margin: 0;
cursor: pointer;
}
.freeform-fieldtype-opinion_scale .opinion-scale-scales li:first-child label {
border: 0;
border-left: 0;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.freeform-fieldtype-opinion_scale .opinion-scale-scales li label:hover {
background-color: #eaeaea;
}
.freeform-fieldtype-opinion_scale input[type='radio']:checked + label {
background-color: #cbced0;
}
.freeform-fieldtype-opinion_scale
.opinion-scale-scales:has(> li input.freeform-has-errors),
.freeform-fieldtype-opinion_scale
.opinion-scale:has(+ ul.freeform-errors)
.opinion-scale-scales {
border: 1px dashed #dc3545;
}
.freeform-fieldtype-opinion_scale .opinion-scale-legends li {
font: normal 15px sans-serif;
color: #6c757d;
padding: 10px 0;
margin-top: 0;
}

/* RATING FIELDS */
.freeform-fieldtype-rating .freeform-has-errors + label:not(:first-child),
.freeform-fieldtype-rating div:has(+ ul.freeform-errors) label {
color: #dc3545;
}
.form-rating-field-wrapper input[type='radio'] + label {
margin-right: 5px;
}

/* FILE UPLOAD DRAG & DROP FIELDS */
.freeform-file-drag-and-drop {
background-color: #ffffff !important;
border: 1px dashed #6c757d !important;
}
.freeform-file-drag-and-drop input {
display: none !important;
}
.freeform-file-drag-and-drop[data-contains-files] {
padding-top: 35px;
}
.freeform-file-drag-and-drop__placeholder {
font: italic 200 16px sans-serif !important;
color: #969696;
}
.freeform-file-drag-and-drop [data-messages] > li[data-error],
.freeform-file-drag-and-drop [data-field-errors] > li[data-error] {
font: 200 16px sans-serif;
color: #dc3545;
margin-top: 15px;
}
.freeform-file-drag-and-drop [data-field-errors] > li {
color: #dc3545;
}

/* SIGNATURE FIELDS */
.freeform-fieldtype-signature button {
font: 400 16px sans-serif;
color: #6c757d;
border: 1px solid #6c757d;
background-color: transparent;
}
.freeform-fieldtype-signature button:hover {
color: #fff;
background-color: #6c757d;
border-color: #6c757d;
}
.freeform-fieldtype-signature canvas {
border: 1px solid #6c757d;
border-radius: 5px;
}

/* TABLE FIELDS */
.freeform-fieldtype-table table {
width: 100%;
font: 400 14px sans-serif;
text-align: left;
}
.freeform-fieldtype-table table thead tr th {
padding-bottom: 10px;
}
.freeform-fieldtype-table table tbody tr:only-child button {
display: none;
}
.freeform-fieldtype-table table tbody tr td {
padding: 0 10px 10px 0;
}
.freeform-fieldtype-table table tbody tr td:last-child {
text-align: right;
padding-right: 0;
}
.freeform-fieldtype-table table button[data-freeform-table-remove-row] {
font-size: 1px;
margin: 0;
padding: 0;
visibility: hidden;
}
.freeform-fieldtype-table table button[data-freeform-table-remove-row]:after {
font: 400 14px sans-serif;
color: #b02a37;
line-height: 1.5;
content: '✕';
border: 1px solid #b02a37;
border-radius: 5px;
padding: 5px 15px;
display: inline-block;
vertical-align: middle;
cursor: pointer;
visibility: visible;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out;
}
.freeform-fieldtype-table
table
button[data-freeform-table-remove-row]:hover:after {
color: #ffffff;
background-color: #b02a37;
border-color: #b02a37;
}
.freeform-fieldtype-table button[data-freeform-table-add-row] {
font: 400 14px sans-serif;
line-height: 1.5;
color: #146c43;
content: '+';
border: 1px solid #146c43;
background-color: transparent;
margin: 0;
}
.freeform-fieldtype-table button[data-freeform-table-add-row]:hover {
color: #ffffff;
background-color: #146c43;
border-color: #146c43;
}
.freeform-fieldtype-table button[data-freeform-table-add-row]:after {
content: '+';
margin-left: 5px;
}

.freeform-row [class*='freeform-col-'].freeform-fieldtype-table input,
.freeform-row [class*='freeform-col-'].freeform-fieldtype-table select {
padding: 10px;
}
.freeform-row [class*='freeform-col-'].freeform-fieldtype-table select {
background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(
1em + 2px
), calc(100% - 2.5em) 0.5em !important;
background-size: 5px 5px, 5px 5px, 1px 23px !important;
}
.freeform-fieldtype-table input[type='checkbox'] {
display: block;
transform: scale(1.15);
}
.freeform-fieldtype-table select {
min-width: 200px;
}

/* SUBMIT BUTTON ALIGNMENT */
.freeform-row [class*='freeform-col-'].freeform-column-content-align-left {
display: flex;
justify-content: flex-start;
}
.freeform-row
[class*='freeform-col-'].freeform-column-content-align-left
> button:not(:first-of-type) {
margin-left: 5px;
}
.freeform-row [class*='freeform-col-'].freeform-column-content-align-center {
display: flex;
justify-content: center;
}
.freeform-row
[class*='freeform-col-'].freeform-column-content-align-center
> button:not(:first-of-type) {
margin-left: 5px;
}
.freeform-row [class*='freeform-col-'].freeform-column-content-align-right {
display: flex;
justify-content: flex-end;
}
.freeform-row
[class*='freeform-col-'].freeform-column-content-align-right
> button:not(:first-of-type) {
margin-left: 5px;
}
.freeform-row [class*='freeform-col-'].freeform-column-content-align-spread {
display: flex;
justify-content: space-between;
}
.freeform-row
[class*='freeform-col-'].freeform-column-content-align-spread
> button:not(:first-of-type) {
margin-left: 5px;
}

/* ERRORS AND SUCCESS */
.freeform-form-success,
.freeform-form-errors {
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
padding: 15px 20px;
border-radius: 5px;
}
.freeform-form-success p,
.freeform-form-errors p {
font: normal 18px sans-serif;
color: #ffffff;
margin: 0;
}
.freeform-form-success ul,
.freeform-form-errors ul {
font: italic 15px sans-serif;
color: #ffffff;
margin: 10px 0 0 0;
padding: 0 0 0 25px;
}
.freeform-form-success ul li:not(:last-child),
.freeform-form-errors ul li:not(:last-child) {
margin-bottom: 5px;
}
.freeform-form-success {
background-color: #198754;
border: 1px solid #198754;
}
.freeform-form-errors {
background-color: #dc3545;
border: 1px solid #dc3545;
}

/* RESPONSIVE GRID */
@media only screen and (max-width: 800px) {
[class*='freeform-col-'] {
width: 100%;
}
}
@media only screen and (min-width: 801px) {
.freeform-col-1 {
width: 8.33%;
}
.freeform-col-2 {
width: 16.66%;
}
.freeform-col-3 {
width: 25%;
}
.freeform-col-4 {
width: 33.33%;
}
.freeform-col-5 {
width: 41.66%;
}
.freeform-col-6 {
width: 50%;
}
.freeform-col-7 {
width: 58.33%;
}
.freeform-col-8 {
width: 66.66%;
}
.freeform-col-9 {
width: 75%;
}
.freeform-col-10 {
width: 83.33%;
}
.freeform-col-11 {
width: 91.66%;
}
.freeform-col-12 {
width: 100%;
}
}

JS

The following JS is a supplemental starting point to handle additional elements in the form.

// Adjustments for Success and Errors classes
document.addEventListener('freeform-ready', function (event) {
event.options.errorClassBanner = 'freeform-form-errors';
event.options.errorClassList = 'freeform-errors';
event.options.errorClassField = 'freeform-has-errors';
event.options.successClassBanner = 'freeform-form-success';
});
// Styling for Stripe Payments field
document.addEventListener('freeform-stripe-styling', function (event) {
(event.detail.base = {
fontSize: '16px',
color: '#464747',
fontFamily:
'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',
'::placeholder': {
color: '#abb5be',
},
}),
(event.detail.invalid = {
color: '#dc3545',
});
});

Live Demo

The demo below is a live demo site that shows most of what the Demo Templates include (some sections and data has been limited).