Web Development - HTML Page
Your First HTML File
Let's create your first real web page! This will help you understand how HTML works and how your browser displays code.
Tip: Don't worry if it feels new - this is where every web developer starts.
1. Create a Folder
Start by creating a folder on your computer. You can name it anything you like - for example:
my-first-website/
index.html
Your website's files will go inside this folder. The main page is usually named index.html.
2. Create a New File
Open your text editor (like Notepad). Create a new file and save it inside your folder as:
index.html
Now you're ready to start coding your first web page.
3. Add Content
Every HTML page starts with a simple structure.
Copy and paste the following into your index.html file:
Example
Basic HTML page:
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>Welcome to my very first web page.</p>
</body>
</html>
Try it Yourself »
Tip: Save your file frequently - use Ctrl + S (Windows) or Cmd + S (Mac).
4. Open Your Page in a Browser
Now, open your folder and double-click the index.html file.
It will open in your browser and display your first website:
Congratulations! You've just built and opened your first HTML file.
5. Try Changing the Text
Experiment! Change the text inside your file and save it. When you refresh your browser, your changes will appear instantly.
Example
Change this line:
<h1>Hello World!</h1>
to this:
<h1>Welcome to My Website!</h1>
Try it Yourself »
Tip: Editing and refreshing is the fastest way to learn. Try different headings and paragraphs, and so on.
6. Try It in W3Schools Spaces
Instead of setting up a local server, you can build and preview your website directly in W3Schools Spaces. It's an online editor that lets you write, run, and host your HTML files instantly - right in your browser.
In Spaces, you can:
- Create files like
index.html,style.css, andscript.js. - Click Run to see your page instantly.
- Use Auto Save so changes appear immediately in the preview.
- Share your project online with a public URL.
Tip: W3Schools Spaces lets you build complete websites without installing anything - perfect for practicing HTML, CSS, and JavaScript together.
However, you can also just follow this tutorial and use our online Try It Yourself Editor as you go. It lets you write and run HTML, CSS and JavaScript directly in your browser, but note that you can't save your progress or upload files there.
Summary
- You created your first HTML file
- You learned the structure of a web page
- You viewed your page in a browser
- You can continue learning and building in W3Schools Spaces
In the next chapter, you'll learn about the core building blocks of HTML - elements and tags.