<div class="form-container">
<form id="contact_form">
<div class="mb-3 form-row">
<div class="mr-3 form-col">
<label for="name_input">Your Name:</label>
<input type="text" name="name" id="name_input" placeholder="Name" />
</div>
<div class="form-col">
<label>Email:</label>
<input type="email" placeholder="name@website.com" />
</div>
</div>
<div class="mb-3">
<label>Message:</label>
<textarea rows="6" class="w-full border border-gray"></textarea>
</div>
<div class="mb-3">
<button class="btnx" type="submit">Send</button>
</div>
</form>
</div>
<style>
/*CSS Reset code. to reset browser defaults */
*,
::before,
::after {
box-sizing: border-box; /* 1 */
border-width: 0; /* 2 */
border-style: solid; /* 2 */
border-color: #e5e7eb; /* 2 */
}
::before,
::after {
--tw-content: '';
}
html {
line-height: 1.5; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-moz-tab-size: 4; /* 3 */
-o-tab-size: 4;
tab-size: 4; /* 3 */
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */
}
body {
margin: 0; /* 1 */
line-height: inherit; /* 2 */
}
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
font-weight: inherit; /* 1 */
line-height: inherit; /* 1 */
color: inherit; /* 1 */
margin: 0; /* 2 */
padding: 0; /* 3 */
}
/*Form styles start*/
.mb-3 {
margin-bottom: 0.75rem;
}
.mr-3 {
margin-right: 0.75rem;
}
.w-full {
width: 100%;
}
.border {
border-width: 1px;
}
input[type=text], input[type=email] {
height: 2.25rem;
width: 100%;
border-radius: 0.25rem;
border-width: 1px;
--tw-border-opacity: 1;
border-color: rgb(156 163 175 / var(--tw-border-opacity));
padding-left: 0.5rem;
padding-right: 0.5rem;
--tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity));
--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
input[type=text]:focus, input[type=email]:focus {
border-width: 2px;
--tw-border-opacity: 1;
border-color: rgb(96 165 250 / var(--tw-border-opacity));
outline: 2px solid transparent;
outline-offset: 2px;
}
textarea {
width: 100%;
border-radius: 0.25rem;
border-width: 1px;
--tw-border-opacity: 1;
border-color: rgb(156 163 175 / var(--tw-border-opacity));
padding: 0.5rem;
--tw-text-opacity: 1;
color: rgb(55 65 81 / var(--tw-text-opacity));
--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
label {
display: block;
font-size: 0.875rem;
line-height: 1.25rem;
--tw-text-opacity: 1;
color: rgb(75 85 99 / var(--tw-text-opacity));
}
.form-container {
width: 100%;
}
.form-container {
margin-left: auto;
margin-right: auto;
padding: 1rem;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.form-row {
display: flex;
width: 100%;
}
.form-col {
width: 50%;
}
button.btnx {
border-radius: 0.25rem;
border-width: 1px;
--tw-border-opacity: 1;
border-color: rgb(107 114 128 / var(--tw-border-opacity));
--tw-bg-opacity: 1;
background-color: rgb(59 130 246 / var(--tw-bg-opacity));
padding-left: 2rem;
padding-right: 2rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
button.btnx:hover {
--tw-scale-x: 1.1;
--tw-scale-y: 1.1;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
button.btnx:active {
--tw-scale-x: .95;
--tw-scale-y: .95;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
</style>
To seamlessly integrate the form code from ReusableForms.com into your web page, follow these simple steps:
The form code provided above is for the client side only. To fully benefit from the form's features, you'll need a back-end form processor. Ratufa is one such service, and integrating with it is straightforward. Watch the video demo for a step-by-step example.
To receive email notifications upon form submissions, store submission records, and search through them later, you'll need a back-end processor. Here's how to set one up: