Thank you for purchasing the Flat Contact Form! This document will guide you through the installation and usage of this clean, colorful, and modern contact form.
contactform-TF/
└── documentation/
├── index.html
├── flat.html
├── minimal.html
├── modern.html
├── retro.html
├── sophisticated.html
└── preview/
├──
└──
├── common.css
├── contact-form-flat.html
├── contact-form-flat.css
├── contact-form-flat.js
├── contact-form-minimal.html
├── contact-form-minimal.css
├── contact-form-minimal.js
├── contact-form-modern.html
├── contact-form-modern.css
├── contact-form-modern.js
├── contact-form-retro.html
├── contact-form-retro.css
├── contact-form-retro.js
├── contact-form-sophisticated.html
├── contact-form-sophisticated.css
├── contact-form-sophitiscated.js
├── README.txt
To install the Flat Contact Form, simply include the contact-form-flat.html
, contact-form-flat.css
, and contact-form-flat.js
files in your HTML project.
Here's a visual representation of the required files:
Copy the HTML code from contact-form-flat.html
into the desired location in your website's HTML structure. Make sure to link the contact-form-flat.css
file in the <head>
section and include the contact-form-flat.js
file before the closing <body>
tag.
<head>
<link rel="stylesheet" href="path/to/contact-form-flat.css">
</head>
<body>
<!-- Your content -->
<form class="contact-form flat" action="#" method="POST" novalidate>
<div class="form-group">
<label for="name-flat">Name:</label>
<input type="text" id="name-flat" name="name" required aria-required="true" placeholder="Your name">
<span class="validation-icon success"><svg ...></svg></span>
<span class="validation-icon error"><svg ...></svg></span>
</div>
<div class="form-group">
<label for="email-flat">Email:</label>
<input type="email" id="email-flat" name="email" required aria-required="true" placeholder="Your email">
<span class="validation-icon success"><svg ...></svg></span>
<span class="validation-icon error"><svg ...></svg></span>
</div>
<div class="form-group">
<label for="message-flat">Message:</label>
<textarea id="message-flat" name="message" rows="5" required aria-required="true" placeholder="Your message"></textarea>
<span class="validation-icon success"><svg ...></svg></span>
<span class="validation-icon error"><svg ...></svg></span>
</div>
<button type="submit">Send Message</button>
</form>
<script src="path/to/contact-form-flat.js"></script>
</body>
The Flat Contact Form features a clean, colorful, and modern design. You can easily customize its appearance by modifying the CSS rules in the contact-form-flat.css
file. Here's how to adjust key visual elements:
Modify the following CSS properties to personalize the color scheme of the form:
background-color
property of the .contact-form.flat
class.
.contact-form.flat {
background-color: #f0f0f0; /* Default light gray */
/* For a light blue background: */
/* background-color: #e3f2fd; */
}
color
property of the .contact-form.flat label
rule.
.contact-form.flat label {
color: #555; /* Default medium gray */
/* For a dark blue label text: */
/* color: #1565c0; */
}
background-color
property in the rules for .contact-form.flat input[type="text"]
, .contact-form.flat input[type="email"]
, .contact-form.flat input[type="tel"]
, and .contact-form.flat textarea
.
.contact-form.flat input[type="text"],
.contact-form.flat input[type="email"],
.contact-form.flat input[type="tel"],
.contact-form.flat textarea {
background-color: #fff; /* Default white */
/* For a very light gray input background: */
/* background-color: #f5f5f5; */
}
background-color
of the .contact-form.flat input:focus
and .contact-form.flat textarea:focus
rules.
.contact-form.flat input:focus,
.contact-form.flat textarea:focus {
background-color: #e0f7fa; /* Default light blue */
/* For a light green focus: */
/* background-color: #e8f5e9; */
}
background-color
of the .contact-form.flat button[type="submit"]
rule.
.contact-form.flat button[type="submit"] {
background-color: #2196f3; /* Default vibrant blue */
/* For a vibrant green button: */
/* background-color: #4caf50; */
}
color
property in the .contact-form.flat button[type="submit"]
rule. The default is white
.
.contact-form.flat button[type="submit"] {
color: white; /* Default white */
/* For dark text on a light button: */
/* color: #333; */
}
background-color
in the .contact-form.flat button[type="submit"]:hover
rule.
.contact-form.flat button[type="submit"]:hover {
background-color: #1976d2; /* Default darker blue */
/* For a darker green hover: */
/* background-color: #388e3c; */
}
color
property of the .contact-form.flat .validation-icon.success
(default: green
) and .contact-form.flat .validation-icon.error
(default: red
) rules.
.contact-form.flat .validation-icon.success {
color: green; /* Default green */
/* For a different success color: */
/* color: #66bb6a; */
}
.contact-form.flat .validation-icon.error {
color: red; /* Default red */
/* For a different error color: */
/* color: #e57373; */
}
background-color
and border-left-color
of the .contact-form.flat input.is-invalid
and .contact-form.flat textarea.is-invalid
rules.
.contact-form.flat input.is-invalid,
.contact-form.flat textarea.is-invalid {
background-color: #ffebee; /* Default light pink */
border-left: 3px solid #f44336; /* Default red left border */
/* For a light yellow background and dark yellow border: */
/* background-color: #fffde7; */
/* border-left-color: #fbc02d; */
}
color
property of the .contact-form.flat .error-message
rule.
.contact-form.flat .error-message {
color: #f44336; /* Default red */
/* For an orange error message: */
/* color: #ff9800; */
}
To customize the font used in the form, modify the font-family
property in the CSS rules for .contact-form.flat label
, .contact-form.flat input
, .contact-form.flat textarea
, and .contact-form.flat button
. Refer to the "Typography" section in the Minimal style documentation for instructions on integrating Google Fonts.
Adjust the size and spacing of the form elements by modifying properties like max-width
, padding
, and margin
in the CSS rules for the respective elements (.contact-form.flat
, .contact-form.flat .form-group
, .contact-form.flat input
, .contact-form.flat textarea
, .contact-form.flat button
). The principles are similar to those described in the Minimal style documentation.
As with the other styles, you can use the .d-none
utility class from common.css
to hide optional fields by adding it to the .form-group
of the field in your HTML. Ensure that common.css
is linked in the <head>
of your HTML file.
The text for the labels and the submit button can be directly changed within the contact-form-flat.html
file by editing the text content of the <label>
and <button>
elements.
Important: This contact form provides the front-end structure and client-side validation only. To handle the form submission (sending emails, storing data), you will need to integrate a backend solution using a server-side language (like PHP, Node.js, Python) or a third-party service (like Formspree, Netlify Forms).
You would typically create a PHP script to handle the form submission when the user clicks "Send Message". The action
attribute of the <form>
tag would point to this PHP script.
<form class="contact-form flat" action="process_form.php" method="POST" novalidate>
<!-- ... form fields ... -->
<button type="submit">Send Message</button>
</form>
Your process_form.php
file would then handle the data submitted via the $_POST
superglobal, perform server-side validation, and send the email.
Formspree is a service that allows you to receive emails from your HTML forms without writing any backend code.
action
attribute of your HTML form with this URL.
<form class="contact-form flat" action="https://formspree.io/f/your_form_endpoint" method="POST" novalidate>
<!-- ... form fields ... -->
<button type="submit">Send Message</button>
</form>
Formspree can also handle basic spam protection and email notifications.
Remember that client-side validation (provided by the JavaScript) is for user convenience. You must implement server-side validation to protect your website from malicious input and ensure data integrity.
To translate the form labels and any potential JavaScript error messages, you will need to modify the text content directly in the contact-form-flat.html
file for the labels and in the contact-form-flat.js
file for the error messages.
This contact form is designed with accessibility in mind:
<label>
elements associated with their respective inputs using the for
attribute.aria-required="true"
for required fields.The form is lightweight and optimized for performance with minimal CSS and JavaScript.
For any questions or issues, please refer to the ThemeForest support section for this item.
Thank you again for your purchase!