A static website is a set of ready-made files (HTML, CSS, JavaScript and images) that the web server sends exactly as they are. There is no database and no code running per visit, which makes static sites fast, cheap to host and hard to hack. This handbook covers the principles that matter in 2026, from clean HTML to generators and publishing.
Build on semantic HTML, modern CSS (Grid, Flexbox, custom properties) and JavaScript that only enhances pages that already work. Keep pages fast with correctly sized modern images and little JavaScript, and make them accessible and findable with proper headings, alt text, titles and descriptions. Use a static site generator such as Astro, Eleventy or Hugo once you have more than a handful of pages. To publish, upload the finished files to public_html on any shared hosting plan with the File Manager or FTP.
1. What "static" means, and when it fits
"Static" describes how pages are delivered, not how they look: a static page can have animations, search and forms, but it is built before anyone visits instead of by server code on each request.
| Approach | How pages are made | Good for |
|---|---|---|
| Hand-written static | You write each HTML file | Small sites, landing pages, learning |
| Static site generator (SSG) | A build tool turns templates and Markdown into HTML | Blogs, documentation, business sites with many pages |
| Dynamic (PHP, Node.js, a CMS) | Server code builds each page per visit | Logins, shops, user content, anything personalised |
- Speed: files are served straight from disk or a cache
- Security: no database or server code to attack
- Low cost and simple hosting
- Easy backups and version control, since the whole site is files
- Content changes need an edit and a re-upload, or a rebuild
- Forms, search and comments need a small script or an outside service
- Not suitable for logins or per-user content without a back end
2. The three foundations
HTML carries meaning. Use header, nav, main, article, section, aside and footer for page regions, one h1 per page with headings in order, real button and a elements for actions and links, and lang="en" (or your language) on the html element. Good structure helps screen readers and search engines at the same time.
CSS handles layout and look. Modern CSS covers what once needed frameworks:
- Flexbox for rows of items (a menu, a toolbar); Grid for two-dimensional layouts and card grids.
- Custom properties (
--brand: #0a5) for colours and spacing you reuse. clamp()for text that scales smoothly between phone and desktop.- Container queries so a component adapts to the space it is given, not just the screen width.
- Native nesting, now supported in current browsers, for tidier stylesheets without a preprocessor.
JavaScript enhances. Build every page so it works without JavaScript, then add behaviour on top: a menu toggle, a filter, a lightbox. Use plain JavaScript and ES modules; jQuery is no longer needed for DOM work in current browsers.
3. Structure the site and its URLs
A sitemap on paper (Home, About, Services, Contact) becomes your folder structure:
site/
├── index.html
├── about/index.html
├── services/index.html
├── contact/index.html
├── assets/css/styles.css
├── assets/js/main.js
└── assets/img/Putting each page in its own folder as index.html gives clean addresses such as /about/ instead of /about.html. Use lowercase names with hyphens, never spaces. Keep navigation identical on every page and mark the current page with aria-current="page".
4. Accessibility and SEO basics
Most accessibility and SEO work is the same work: clear structure and honest text.
- A unique
titleandmeta name="description"on every page. - Descriptive
alttext on meaningful images;alt=""on decorative ones. - Text contrast of at least 4.5:1, and visible focus outlines for keyboard users.
- Link text that makes sense on its own ("Download the price list", not "click here").
- A
sitemap.xmllisting your pages, and arobots.txtthat points to it. - A custom 404 page that links back to the home page.
Test with Lighthouse in Chrome DevTools and by moving through each page with the Tab key.
5. Performance: the static advantage
A static site starts fast; keep it that way. Google's Core Web Vitals measure loading (Largest Contentful Paint), responsiveness (Interaction to Next Paint) and visual stability (Cumulative Layout Shift).
- Images: export at the size they display, in WebP or AVIF, and use
srcsetto offer several sizes. Addwidthandheightto prevent layout shift, andloading="lazy"to images below the fold, but not to the main image at the top. - Fonts: use one or two families, self-host them as WOFF2 and set
font-display: swap. - JavaScript: load it with
deferor as a module, and question every library. A static page rarely needs more than a few kilobytes. - CSS: one small stylesheet usually beats a whole framework you use a tenth of.
6. Static site generators
Repeating the header and footer by hand across many pages invites mistakes. A static site generator builds the final HTML from templates and content files on your computer, and you upload only the output.
| Generator | Written in | Known for |
|---|---|---|
| Astro | JavaScript | Component-based pages that ship no JavaScript unless you add it |
| Eleventy (11ty) | JavaScript | Simple, flexible, works with plain HTML and Markdown |
| Hugo | Go | A single fast binary; builds thousands of pages in seconds |
| Jekyll | Ruby | The long-standing option behind GitHub Pages |
A typical workflow looks like this (Astro shown; the others are similar):
npm create astro@latest my-site
cd my-site
npm run dev # local preview with live reload
npm run build # writes the finished site to dist/The output folder has different names: dist for Astro and Vite, _site for Eleventy and Jekyll, public for Hugo. It is that folder's contents you publish. Use a current Node.js LTS release for JavaScript-based generators.
7. Forms and other dynamic features
A static site can still take enquiries and show dynamic content:
- Contact forms: on shared hosting, a short PHP script can receive the form and email it to you. Validate every field on the server, add a hidden honeypot field against spam bots, and never put a password or API key in front-end JavaScript. See PHP sendmail settings.
- Search: a build-time index (for example Pagefind) gives instant search with no server.
- Content editing: a headless CMS can let non-developers edit content that the generator pulls in at build time.
8. Version control and publishing workflow
Keep the site in Git from day one, so every change is recorded and can be undone. Commit your source files; add build folders (dist, _site) and node_modules to .gitignore. The routine is: edit, preview, commit, build, upload the output. A CI service can later automate the last two steps.
9. Hosting a static site on Domain India
A static site needs nothing more than a web server, so every Domain India shared hosting plan (cPanel, DirectAdmin or Webuzo) can serve it, with free SSL included.
- Build the siteif you use a generator, then zip the contents of the output folder so
index.htmlis at the top of the zip. - Upload the zipinto
public_htmlwith your control panel's File Manager and extract it there, or upload the files with FTP. - Open your domainand click through every page. Fix any broken links or missing images before you share it.
Useful details:
- The File Manager and FTP steps are in How to use the File Manager and What settings do I need to upload my website.
- On cPanel, a page can be served from cache for up to 120 minutes. Add
?t=1to the address to check that an update is live. - On DirectAdmin,
index.htmlis served beforeindex.php, so delete any leftoverindex.htmlif you later move to PHP or WordPress. .htaccessworks on all three panels, so you can add a custom 404 page withErrorDocument 404 /404.html.- The App Platform is built for applications. It can serve a static site only if you run it as a small Node.js server or from a Dockerfile, which is unnecessary for most static sites.
If you would rather not write code, the AI Website Builder builds and hosts a site for you.
- 25 GB NVMe SSD Storage
- 50 GB Monthly Bandwidth
- 1 Website
- 10 Email Accounts
- 10 GB NVMe SSD Storage
- 50 GB Monthly Bandwidth
- 1 Website
- 5 Email Accounts
What is static web development?
Building websites from ready-made HTML, CSS, JavaScript and image files that the server sends as they are, without a database or server code running for each visit.
Can a static website have a contact form?
Yes. On shared hosting a small PHP script can receive the form and email it to you, or you can use a form service. Validate input on the server and keep any keys out of front-end code.
Do I need a static site generator?
Not for a few pages. Once you repeat the same header and footer across many pages, or write blog posts in Markdown, a generator such as Astro, Eleventy or Hugo saves time and prevents mistakes.
Is a static website good for SEO?
Yes. Static pages load fast and are easy for search engines to read. Give each page a unique title and description, use proper headings and alt text, and publish a sitemap.xml.
Which folder do I upload after building with a generator?
The contents of its output folder: dist for Astro and Vite, _site for Eleventy and Jekyll, public for Hugo. Upload them into public_html.
Can I host a static website on Domain India shared hosting?
Yes. Any cPanel, DirectAdmin or Webuzo plan can serve it. Upload the files to public_html with the File Manager or FTP; free SSL is included.
Ready to publish? Register a domain name, choose cPanel hosting or DirectAdmin hosting, or ask us in a support ticket if you need help uploading.
Upload your files with the File Manager or FTP. Free SSL is included with every hosting plan.
See hosting plans