Building a Simple One‑Page Website with a Working Contact Form
Creating a professional website doesn’t have to be complicated. In this guide, we’ll walk through how to build a simple one‑page website for a generic company. We’ll include a working contact form, explain how it works, and cover the basics of connecting the site to a domain name.
Why a One‑Page Website?
A one‑page site is perfect for freelancers, small businesses, or anyone starting out. It offers:
-
A clean, focused experience for visitors.
-
Easy maintenance (just one page to update).
-
Quick loading times.
Example Website Code
Here’s a minimal HTML, CSS, and JavaScript website you can copy into a file named index.html
:
How the Form Works
-
The
<form>
uses a service like Formspree (https://formspree.io) to handle submissions. -
Replace
yourformid
with the ID from your Formspree account. -
When a visitor submits, you’ll receive the message in your email.
If you have your own server, you can swap out the action
with your backend script (PHP, Node.js, etc.) to process form submissions directly.
Hosting the Website
-
Save the File: Put the
index.html
file in a folder. -
Choose a Hosting Service: Examples:
-
GitHub Pages (free)
-
Netlify (free tier available)
-
Traditional hosting (Bluehost, HostGator, SiteGround, etc.).
-
-
Upload: Drag and drop your site into the hosting platform.
Adding a Domain Name
-
Register a Domain: Buy from providers like Namecheap, GoDaddy, or Google Domains.
-
Point to Host: In your registrar’s dashboard, update DNS records to point to your hosting provider’s servers (your host gives you these values).
-
Verify: Within 24–48 hours, your domain should display your website.
Next Steps
-
Add more sections (Services, Portfolio, Testimonials).
-
Improve design with frameworks like Bootstrap or TailwindCSS.
-
Secure your site with HTTPS (most modern hosts provide free SSL via Let’s Encrypt).
Conclusion: With just one file, you can launch a functional website and connect it to a domain. Over time, you can expand with blogs, e‑commerce, or custom backends, but starting simple ensures you get online fast.