Reviewed July 2026. This article was substantially updated to reflect current web standards and practices.
Writing a small page by hand is still one of the best ways to understand how websites work. Start with structure, use CSS for presentation, and test the result in more than one viewport.
Create the document shell
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page title</title>
</head>
<body>
<main>Your content</main>
</body>
</html>Add meaningful content
Use one descriptive page heading, shorter section headings, paragraphs, lists, and links whose text explains the destination. Add useful alternative text to informative images and empty alternative text to decorative images.
Separate presentation
Connect a stylesheet with a link element. Avoid using old presentational HTML attributes or formatting tags for layout. A small mobile-first stylesheet is easier to maintain than styles scattered through the markup.
Test before publishing
Check keyboard navigation, narrow and wide screens, missing images, long text, form labels, and the browser console. Validate the markup when something behaves unexpectedly, but remember that a passing validator does not replace usability and accessibility testing.
Grow the page in a deliberate order
After the document shell, write the content as a plain outline. Add a primary heading, introductory paragraph, sections with useful headings, lists where order or grouping matters, and links that name their destination. Add images only when they explain, demonstrate, or prove something the text cannot communicate as well.
Next, identify landmarks. Most pages need a header, navigation, one main region, and a footer. An article may have its own header and sections. Not every visual group needs a section; use it when the group has a meaningful heading and belongs in the document outline.
Add CSS without losing resilience
Start with readable base typography and spacing, then create the smallest useful layout. Use a centered content width, flexible images, and a mobile-first flow. Add Grid or Flexbox when the relationship between items calls for it. Test the page before adding animation or complex interaction.
Publish with the surrounding details
- Use a unique, descriptive title and a concise page description.
- Choose one canonical URL and redirect alternate or moved versions.
- Return a real 404 response for missing pages.
- Serve the page over HTTPS and avoid mixed-content resources.
- Check link destinations, form delivery, error states, and confirmation states.
- Include the page in navigation and an XML sitemap when it should be indexed.
Keep the source in version control so every change can be reviewed and reversed. Even a small static page benefits from a repeatable deployment process and a clear owner.
