Site icon Cyber & Web Development Code Lab

Create Your First Web Page Using HTML (With Code + Output)






Introduction

If you’re starting web development, the first thing you need to learn is how to create a basic web page using HTML.

In this guide, you will learn:

No prior experience required.

What is HTML?

HTML (HyperText Markup Language) is the standard language used to create web pages.

It defines:

Think of HTML as the skeleton of a website

Requirements

You only need:

Step 1: Create HTML File

  1. Open Notepad
  2. Click File → Save As
  3. Save as:

index.html Download Here

Code Explanation

<!DOCTYPE html> → Defines HTML5

<html> → Root element

<head> → Contains title

<body> → Visible content

<h1> → Heading

<p> → Paragraph

Step 3: Run the Web Page

  1. Save file as .html (for our example save it as index.html)
  2. Double click index.html
  3. It will open in browser

Output of Example

You will see:

Step 4: Add Link and Image

Updated Code

<!DOCTYPE html>
<html>
<head>
    <title>My First Web Page</title>
</head>
<body>

    <h1>Welcome to My Website</h1>
    <p>This is my first HTML page.</p>

    <a href="https://www.google.com">Visit Google</a>
    <br><br>

    <img src="https://via.placeholder.com/150" alt="Sample Image">

</body>
</html>

What’s New?

Step 5: Add List Example

<ul>
    <li>HTML</li>
    <li>CSS</li>
    <li>JavaScript</li>
</ul>

Final Output Includes

Now your page looks more complete

Updated Example Download Here

Common Beginner Mistakes

Important to Note

Revise

Exit mobile version