Getting Started with HTML: Your First Web Page
Getting Started with HTML: Your First Web Page
HTML (HyperText Markup Language) is the foundation of all websites. Whether you’re building a personal blog or a complex web application, HTML is the starting point for everything on the web.
In this tutorial, we’ll cover how to create a basic HTML page and display a simple “Hello World” message using heading tags. Let’s dive in!
Step 1: Set Up Your HTML File
First, you’ll need a plain text editor like Notepad (Windows), TextEdit (Mac in plain text mode), or any code editor like VS Code or Sublime Text.
Create a new file and name it index.html
.
Step 2: Basic HTML Structure
Here’s a simple template to start with:
My First HTML Page
<!-- Your content goes here -->
This structure includes:
<!DOCTYPE html>: Declares the document type.
<html>: The root element of the page.
<head>: Contains meta-information like the page title.
<body>: Contains the content visible to users.
Step 3: Add a "Hello World" Message
Now, let’s display a "Hello World" message using HTML heading tags. Headings range from <h1> (most important) to <h6> (least important).
<body>
<h1>Hello World - H1</h1>
<h2>Hello World - H2</h2>
<h3>Hello World - H3</h3>
<h4>Hello World - H4</h4>
<h5>Hello World - H5</h5>
<h6>Hello World - H6</h6>
</body>
Each heading displays the message in different sizes, giving you a clear view of how they appear on the page.
Step 4: Open in a Browser
Save the file, then double-click on it or open it with your web browser. You’ll see your "Hello World" messages displayed from largest to smallest heading.
What’s Next?
Now that you’ve created your first HTML page, you can start exploring more tags like paragraphs, links, and images. HTML is simple, and with each step, you'll be closer to building your own website!