Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

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.

Example

Open this project in W3Schools Spaces:

Try W3Schools Spaces »

In Spaces, you can:

  • Create files like index.html, style.css, and script.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.

Next » HTML Elements


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.