HTML Template

A blank web page you can copy into any text editor, save as an .html file, and open in a browser. Start every page from it. Two fuller starters follow: one with the styles and script built in, and one with a header, navigation, sections and a footer.

The Blank Template

This is the whole thing. Copy it exactly; every line has a job. Change the two places that say My Page and put your content between the <body> tags.

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Page</title>
</head>
<body>

    <h1>My Page</h1>
    <p>Your content goes here.</p>

</body>
</html>

Download blank.html

LineWhat it does
<!DOCTYPE html>Tells the browser this is a modern HTML5 page. Always the first line.
<html lang="en">Wraps the whole page; lang helps screen readers and search engines.
<head>Information about the page. Nothing in here shows on screen.
<meta charset="UTF-8">Lets the page show any character: accents, symbols, emoji.
<meta name="viewport" ...>Makes the page the right width on phones instead of a tiny zoomed-out desktop view.
<title>The text on the browser tab and in bookmarks.
<body>Everything the visitor sees goes between these tags.
<h1>, <p>A heading and a paragraph: the first two tags to learn. Replace them with your own content.

Blank Page with Styles and Script

The same page with a <style> block for CSS and a <script> block for JavaScript built in, so one file holds everything. Good for experiments and homework where you turn in a single file.

index.html (styles and script built in)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Page</title>
    <style>
        /* Your CSS goes here. It applies to the whole page. */
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 40px auto;
            padding: 0 20px;
            line-height: 1.6;
            color: #222;
        }
        h1 {
            color: #3E2E24;
        }
    </style>
</head>
<body>

    <h1>My Page</h1>
    <p>Your content goes here.</p>

    <script>
        // Your JavaScript goes here. It runs after the page above has loaded.
        console.log("The page is ready.");
    </script>
</body>
</html>

Download styled.html

CSS goes inside <style> in the head; JavaScript goes inside <script> at the end of the body, so the page exists before the script touches it. Open the browser’s console (F12, or Cmd+Option+I on a Mac) to see the message it logs.

Full Page Skeleton

The structure of a real site page: a header with navigation, a main area with sections, and a footer, with the styles and script in their own files. Save it with styles.css and script.js next to it (they can be empty to start) and an images folder for the picture.

index.html (header, main, footer)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Site Name</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>

    <header>
        <h1>Site Name</h1>
        <nav>
            <a href="index.html">Home</a>
            <a href="about.html">About</a>
            <a href="contact.html">Contact</a>
        </nav>
    </header>

    <main>
        <section>
            <h2>Welcome</h2>
            <p>Your content goes here.</p>
        </section>

        <section>
            <h2>Another Section</h2>
            <ul>
                <li>First item</li>
                <li>Second item</li>
                <li>Third item</li>
            </ul>
            <img src="images/photo.jpg" alt="Describe the picture" width="300" height="200">
        </section>
    </main>

    <footer>
        <p>&copy; 2026 Your Name</p>
    </footer>

    <script src="script.js"></script>
</body>
</html>

Download skeleton.html

Files that go with it
Why separate files
  • index.html — this page
  • styles.css — the look, shared by every page of the site
  • script.js — the behavior
  • images/photo.jpg — the picture the <img> points at
  • about.html, contact.html — the other pages the links go to, each starting from the blank template

Once a site has more than one page, the styles belong in one .css file that every page links to, so a change in one place changes the whole site. The same goes for scripts. A single-file page is for learning; a folder of files is how sites are built.

Keep the folder and file names exactly as written: images/photo.jpg will not be found if the folder is called Images.