Your First HTML Page

Creating your first HTML page is the first step in web development. In this lesson, you will learn how to write a simple HTML file and display it in a web browser.

Step 1: Create an HTML File

Open Visual Studio Code and create a new file. Save it with the name index.html. Make sure the file extension is .html so it works as a web page.

Step 2: Add Basic HTML Structure

Every HTML page starts with a basic structure. Type the following code into your file <!DOCTYPE html> <html> <head> <title>My First Page</title> </head> <body> <h1>Hello World</h1> <p>This is my first HTML page</p> </body> </html>

This structure tells the browser how to display your content.

Step 3: Understand the Code

The doctype tells the browser that this is an HTML5 document.
The html tag is the root of the page.
The head section contains the title of the page.
The body section contains the content that appears on the screen.

Step 4: Save the File

After writing the code, save your file using Ctrl + S or from the file menu.

Step 5: Open in Browser

Go to your file location and double-click the index.html file. It will open in your default browser.

You will see the heading Hello World and a simple paragraph displayed on the page.

Step 6: Make Changes

Try changing the text inside the heading or paragraph and refresh your browser to see the updates. This helps you understand how HTML works in real time.

Summary

Your first HTML page is a simple file that shows content in the browser. By practicing and making small changes, you can quickly learn how to build web pages.

Home » HTML Fundamentals (Beginner) > Introduction to HTML > Your First HTML Page