How to Build Your First HTML Page (Step-by-Step Guide for Beginners)
If you're just starting your journey into web development, learning how to build your first HTML page is the best place to begin. HTML (HyperText Markup Language) is the foundation of every website — it structures the content you see on the web.
In this guide, we’ll walk you through how to create a basic HTML page from scratch using just a text editor and a browser. Let’s get started!
What You Need
To build your first HTML page, you’ll need:
- A text editor (like VS Code, Notepad, Sublime Text)
- A web browser (Chrome, Firefox, Safari, etc.)
That’s it — no fancy tools or frameworks needed.
Step 1: Create a New HTML File
- Open your text editor.
- Create a new file.
- Save it as
index.html(this is the default name for homepages).
📝 Tip: Save it in a new folder like my-first-website/ to keep things organized.
✍️ Step 2: Add Basic HTML Structure
Copy and paste the following code into your index.html file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to my first HTML page.</p>
</body>
</html>
🔍 Breakdown of the Code
| Line | Purpose |
|---|---|
<!DOCTYPE html> | Tells the browser you’re using HTML5 |
<html> | The root element for the entire page |
<head> | Contains meta info, title, and more |
<title> | Sets the title in the browser tab |
<body> | Holds all visible content |
<h1> | Heading 1 — usually the page’s main title |
<p> | Paragraph text |
🌐 Step 3: Open the File in a Browser
- Go to the folder where you saved
index.html - Double-click the file
- It will open in your default browser — you’ll see:
Hello, World!
Welcome to my first HTML page.
🎉 Congratulations! You just created your first working webpage.
🧪 Step 4: Customize Your Page
Try editing the content inside <h1> and <p> to make it yours:
<h1>Welcome to CodeBookCentral</h1>
<p>This is a test page I made while learning HTML!</p>
Save the file and refresh your browser — you’ll see your changes instantly.
🎨 Bonus: Add a Background Color
Want to style your page a bit? Add this inside your <head> tag:
<style>
body {
background-color: #f0f0f0;
font-family: Arial, sans-serif;
padding: 20px;
}
</style>
Now your page will look cleaner and more modern!
✅ What's Next?
Now that you’ve created a basic HTML page, here’s what you can try next:
- Add an image:
<img src="https://via.placeholder.com/300" alt="Sample Image"> - Add a link:
<a href="https://codebookcentral.com">Visit My Blog</a> - Learn about lists, forms, and tables
🔗 Helpful Resources
💬 Final Thoughts
Creating your first HTML page is a huge step — whether you're building a personal site, learning to become a developer, or just exploring. The best way to improve is to keep practicing.
Got questions or stuck on a step? Drop a comment below or contact me — I’d love to help you out!