A reusable starter template saves you from rewriting the doctype, character set, and title every time. Keep it short enough that you understand every line.
What You Need to Know
Use one title per document, set the page language, and put visible content inside body. Add CSS and scripts only when you actually need them.
The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.
Example: See It in Action
Try this markup in a fresh practice file. The next section explains the parts worth paying attention to.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Starter Page</title>
</head>
<body>
<main>
<h1>New Project</h1>
</main>
</body>
</html>
Let’s Understand the Example
- The html element holds the complete page and usually names its language.
- The head contains useful page information for the browser, such as its title and character encoding.
- A meta element gives the browser short information about the document. Different attributes control different hints.
- Lang tells tools which language the text uses, helping pronunciation and language-aware features.
- Charset tells the browser how to decode the page text; UTF-8 is the usual choice.
- Name is the key the browser normally sends when a form control is submitted.
Some of the markup affects the browser tab or page settings rather than appearing as visible text. Check the browser tab and inspector as well as the page itself.
What Should You See?
The browser tab should show “Starter Page”. The page itself shows “New Project” as a heading; those two labels are allowed to be different.
Read only the headings, from top to bottom. Do they tell a sensible story? If not, move sections or choose levels that match the content.
Try It Yourself
- Save the example as starter.html, then copy it to start a new project.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Copying a huge template full of unnecessary libraries into every practice page.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- A reusable starter template saves you from rewriting the doctype, character set, and title every time.
- The html element holds the complete page and usually names its language.
- Use one title per document, set the page language, and put visible content inside body. Add CSS and scripts only when you actually need them.