HTML Introduction


HTML is the starting point for anyone who wants to build websites or understand how the web works. Every webpage you see online, from simple blogs to large business portals, uses HTML at its core. It provides the structure of the page, defines the placement of text, images and links, and gives the browser instructions about what to display. Learning HTML gives you the foundation you need before moving to CSS, JavaScript or any advanced web development skill.

In this chapter, you’ll explore what HTML is, why it is important, how a basic webpage is created and how the browser reads and interprets HTML code. By the end, you’ll understand how webpages are built from simple building blocks and why HTML remains a must-know language in modern development.

What Is HTML?

HTML stands for HyperText Markup Language. It is not a programming language; instead, it is a markup language used to define the structure of a webpage. HTML works by using predefined tags. These tags tell the browser how each part of the content should be displayed.

For example:

  • <p> tells the browser to show a paragraph.

  • <h1> displays a large heading.

  • <a> creates a link.

  • <img> shows an image.

When these tags come together, they form the full structure of a page. HTML is readable, simple to write and designed to be easy for beginners.

Why Learn HTML?

HTML is the first step in web development. You cannot design or develop a website without understanding how to structure it. Whether you build personal projects or work on large client websites, HTML is always part of the workflow.

Key reasons to learn HTML:

  • It is easy to understand and beginner friendly.

  • It forms the foundation of all webpages.

  • It helps you structure text, images, links and layout.

  • You can quickly build simple websites with only HTML.

  • Understanding HTML makes learning CSS and JavaScript easier.

  • Most professional roles related to web development expect HTML knowledge.

Even modern frameworks like React, Angular and Vue still rely on HTML-like templates. So knowing HTML gives you confidence to work with advanced tools later.

How HTML Works

HTML works with tags. Each tag describes a specific purpose. Most HTML tags come in pairs: an opening tag and a closing tag. Anything you want to display on the webpage sits between these tags.

Example:

<p>This is a paragraph.</p>

The browser reads this code, understands the tag and displays the text as a paragraph.

Some tags don’t need a closing tag. These are called self-closing tags.

For example:

<img src="photo.jpg" />
<br />
<hr />

The browser does not look at HTML like a human. It reads the tags, identifies structure and converts the code into the final layout you see on the screen.

The Structure of an HTML Document

Every HTML page follows a basic structure. It doesn’t matter whether the page is small or large. The structure always begins with a document type declaration and then continues with the main HTML skeleton.

Here is the basic structure:

<!DOCTYPE html>
<html>
<head>
    <title>My First Page</title>
</head>
<body>
    <h1>Hello World</h1>
    <p>Welcome to my first website.</p>
</body>
</html>

Let’s understand what each part means.

<!DOCTYPE html>

This tells the browser that the document is written in HTML5, which is the latest standard.

<html>

This is the root tag. Everything inside this tag belongs to the webpage.

<head>

The head section contains information that is not displayed directly on the page. It includes the title, metadata, stylesheets and scripts.

<title>

This text appears on the browser tab. It helps identify and describe the page.

<body>

This is where visible page content lives. Headings, paragraphs, images, tables and anything the user sees are placed inside the body.

How Browsers Render HTML

When you open a webpage, your browser downloads the HTML file and reads it line by line. As it processes tags, it creates a structured model called the DOM (Document Object Model). The DOM allows scripts and styles to interact with the page.

For example:

  • CSS reads the DOM and changes colors, spacing and layout.

  • JavaScript reads and updates the DOM to make the page interactive.

HTML is the stage on which CSS and JavaScript perform.

First Hands-On Example

Here’s a simple HTML page you can try right now. Create a file named index.html on your computer and paste this code:

<!DOCTYPE html>
<html>
<head>
    <title>Sample Page</title>
</head>
<body>
    <h1>Welcome</h1>
    <p>This is my first HTML page.</p>
</body>
</html>

Save the file and open it in a browser. You will see your first webpage. This is how real web development starts: one simple HTML file at a time.

Features of HTML

HTML has several important features:

Simple and flexible

You don’t need special tools to write HTML. A basic text editor is enough.

Platform independent

HTML works on any device: desktop, laptop, mobile or tablet.

Extensible with CSS and JavaScript

You can change the look and add functionality using other languages.

Structured and organized

Tags help you maintain a clean and understandable layout.

Universal support

Every browser supports HTML, making it the global standard for websites.

Where HTML Is Used

HTML has countless uses in the digital world. You’ll find it everywhere:

  • Webpages and blogs

  • Admin dashboards

  • E-commerce websites

  • Social media platforms

  • Email templates

  • Documentation and help pages

  • Online forms

  • Landing pages for businesses

Even mobile applications with web content internally rely on HTML.

HTML in Real Life

Let’s look at some real-life examples where HTML plays an important role.

Online forms

Whenever you fill a registration form, HTML is responsible for creating text fields, checkboxes and dropdowns.

News websites

Headings, images and article structures are arranged using HTML tags.

Shopping websites

Product lists, filters, descriptions and reviews use HTML for layout.

Educational platforms

Courses, quizzes and video players all rely on HTML for structure.

Corporate websites

Almost every business uses HTML for their online presence.

Example: Building a Small Web Page

Here is a slightly more detailed page to show how multiple tags come together:

<!DOCTYPE html>
<html>
<head>
    <title>About Me</title>
</head>
<body>
    <h1>About Me</h1>
    <p>I enjoy learning web development and exploring new technologies.</p>
    
    <h2>My Hobbies</h2>
    <ul>
        <li>Coding</li>
        <li>Photography</li>
        <li>Music</li>
    </ul>

    <p>Thank you for visiting my page.</p>
</body>
</html>

This example uses headings, lists and paragraphs to create a clean and structured layout. As you learn more tags, you’ll be able to design more advanced pages.

Summary of HTML Introduction

HTML is the foundation of every website. It structures content using simple tag-based rules and gives the browser a clear idea of how to display text, images and layout. In this chapter, you learned what HTML is, why it is important, how its basic structure works and how browsers read it. With this understanding, you’re ready to explore editors, formatting, elements and everything else that builds modern webpages.


Practice Questions

Q1. Create a simple web page with a heading and a paragraph.

Q2. Add a title to your HTML document.

Q3. Display three levels of headings.

Q4. Write a paragraph and make a word bold.

Q5. Create a page with two paragraphs.


Try a Short Quiz.

coding learning websites codepractice

No quizzes available.

Go Back Top