HTML Introduction

👋 First time learning web development?
We recommend starting with our Start Here guide before continuing this lesson. It will help you understand the learning path for HTML, CSS, PHP, and WordPress.

Introduction

HTML stands for HyperText Markup Language. It is the basic building block of every website on the internet. HTML is used to create the structure of web pages by defining elements like headings, paragraphs, images, links, and forms.

What You’ll Learn in This Lesson

In this lesson, you will learn:

  • What HTML is
  • Why HTML is important
  • How HTML works
  • Where HTML is used in real websites

What is HTML?

HTML is not a programming language.
Instead, it is a markup language used to structure content on web pages.

HTML uses tags to define elements on a web page. These tags tell the browser how different parts of the content should appear.

Example:

  • Headings
  • Paragraphs
  • Images
  • Links

Headings

Headings are used to define titles and subtitles on a webpage. HTML provides six levels of headings, from <h1> to <h6>.

HTML provides six heading levels, from <h1> to <h6>. These headings represent different levels in the document’s content hierarchy.

Example:

<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Smaller Subheading</h3>

Headings help organize content and make web pages easier to read. They are also important for SEO because search engines use headings to understand page structure.

Paragraphs

Paragraphs are used to display blocks of text on a webpage. In HTML, paragraphs are created using the <p> tag.

Example:

<p>This is a paragraph of text.</p>
<p>This is another paragraph.</p>

Browsers automatically add space before and after paragraphs to make content easier to read.

Paragraphs are commonly used for:

  • Articles
  • Blog posts
  • Website descriptions
  • Product information

Images

Images help make web pages more visually appealing and informative. HTML uses the <img> tag to display images.

Example:

<img src="image.jpg" alt="Example Image">

Explanation:

  • src specifies the image file location
  • alt provides alternative text if the image cannot be displayed

Images are widely used on websites for:

  • Illustrations
  • Product photos
  • Blog graphics
  • Icons

Links

Links allow users to navigate from one page to another. In HTML, links are created using the <a> tag.

Example:

<a href="https://example.com">Visit Website</a>

Explanation:

  • href specifies the destination URL
  • The text between the tags becomes the clickable link

Links are essential for connecting web pages and creating navigation between different sections of a website.

Why HTML is Important

  • Every website uses HTML
  • HTML gives structure to web pages
  • CSS and JavaScript work on top of HTML
  • Without HTML, a website cannot exist
  • HTML is the foundation of all websites. Technologies like CSS and JavaScript depend on HTML to apply styles and interactive features.

How HTML Works

The process works like this:

  1. A developer writes HTML code in a text file.
  2. The file is saved with a .html extension.
  3. A web browser (such as Chrome or Firefox) reads the HTML file.
  4. The browser interprets the HTML tags and displays the page content.

HTML files are saved with .html extension.

A Simple HTML Example

Basic example only:

<!DOCTYPE html>
<html>
<head>
    <title>My First HTML Page</title>
</head>
<body>
    <h1>Hello World</h1>
    <p>This is my first HTML page.</p>
</body>
</html>

Explanation of Important Tags

  • <h1> – Defines the main heading of the page
  • <p> – Defines a paragraph of text

Where HTML is Used

HTML is used in many places, including:

  • Websites
  • Web applications
  • Forms
  • E-commerce websites
  • HTML emails
  • Progressive web applications
  • Embedded content
  • Content management systems such as WordPress
  • Frontend applications built with JavaScript frameworks

HTML, CSS, and JavaScript

Web development usually involves three main technologies:

TechnologyPurpose
HTMLStructure of the webpage
CSSStyling and design
JavaScriptInteractivity and behavior

HTML creates the structure, CSS improves the design, and JavaScript adds dynamic functionality.

FAQs

What is HTML?

HTML (HyperText Markup Language) is the standard markup language used to structure content on web pages. It defines elements such as headings, paragraphs, links, images, lists, forms, and other page content.

Is HTML a programming language?

No. HTML is a markup language, not a programming language. HTML defines the structure of web content, while programming languages such as PHP and JavaScript are used to implement logic and dynamic functionality.

What is HTML used for?

HTML is used to structure websites and web applications. It can define headings, text, images, links, navigation, forms, tables, multimedia, and semantic page sections.

What are HTML tags and elements?

HTML tags are used to create HTML elements. For example:
<h1>Welcome to My Website</h1>
Here, <h1> and </h1> are tags, while the complete <h1>...</h1> structure is an HTML element.

What is semantic HTML?

Semantic HTML means using HTML elements according to their meaning and purpose. Examples include <header>, <nav>, <main>, <article>, <section>, and <footer>. Semantic HTML can improve document structure, accessibility, and maintainability.

What is the difference between HTML, CSS, and JavaScript?

HTML provides the structure of a web page, CSS controls its appearance and layout, and JavaScript adds behavior and interactivity.
A simple way to remember this is:
HTML → Structure
CSS → Presentation
JavaScript → Behavior

What is the latest version of HTML?

HTML is no longer developed as separate numbered versions such as HTML5. The HTML standard is maintained as a Living Standard, which is continuously updated by the WHATWG.

Is HTML5 still used?

Yes. The term HTML5 is still commonly used to describe modern HTML features, but the current HTML standard is maintained continuously rather than being released as a new numbered version.

Is HTML important for SEO?

Yes. Well-structured HTML helps search engines understand the organization and meaning of page content. Semantic elements, appropriate headings, descriptive links, image alt text, and properly structured content can all contribute to a clearer and more accessible page.

Is HTML important for accessibility?

Yes. Using the correct semantic HTML elements, meaningful headings, descriptive alt text, properly associated form labels, and native interactive elements can make websites easier to use with assistive technologies such as screen readers.

Practical Tasks

Try these small exercises:

  • Task 1: Create a simple HTML page with a heading and a paragraph.
  • Task 2: Change the heading text to your name.
  • Task 3: Add another paragraph describing what you learned about HTML.

Conclusion

HTML is the foundation of web development. It provides the basic structure for every webpage and allows browsers to display content correctly. Once you understand HTML, you can start learning CSS to style your pages and JavaScript to add interactivity.

In the next tutorial, we’ll learn about HTML Basic Structure.

Related Tutorials

  • HTML Website Structure: Basic HTML Document Explained

    ✦ Daily Motivation Every line of code you write is a step toward becoming better. Introduction This basic HTML page structure is also known as an HTML skeleton or HTML boilerplate template. In this lesson, you will learn the basic structure of an HTML document and understand what each part does. What You’ll Learn in…

  • HTML Headings & Paragraphs

    ✦ Daily Motivation Every line of code you write is a step toward becoming better. Introduction Headings and paragraphs are among the most commonly used elements in HTML. They help structure the content and make web pages readable and well-organized. Headings are used to define titles and sections of a webpage, while paragraphs are used…

  • HTML Text Formatting

    ✦ Daily Motivation Every line of code you write is a step toward becoming better. Introduction HTML provides several tags that allow developers to format text on a webpage. Text formatting helps highlight important words, emphasize content, and improve the readability of the page. Using text formatting elements, you can make text bold, italic, underlined,…

  • HTML Links

    ✦ Daily Motivation Every line of code you write is a step toward becoming better. Introduction HTML links are used to connect one page to another page. They allow users to move between different web pages, websites, or sections of the same page. Links are a fundamental part of the web. Without links, browsing the…

  • HTML Images

    ✦ Daily Motivation Every line of code you write is a step toward becoming better. Introduction Images are an important part of any webpage. They make content more attractive, engaging, and easier to understand. In HTML, images are used to display pictures such as photos, icons, logos, and graphics on a webpage. Adding images helps…

  • HTML Lists

    ✦ Daily Motivation Every line of code you write is a step toward becoming better. Introduction HTML lists are used to display items in an organized way. They help structure content clearly and make it easier for users to read and understand information. Lists are commonly used in menus, steps, features, and grouped data on…