Chapter 01 of 26

Introduction to HTML

Every web page you have ever opened — your college result portal, a YouTube video page, a Wikipedia article, or this tutorial — is built on top of one language: HTML. Before you learn CSS, JavaScript, React or any backend framework, you need to understand HTML, because it is the foundation that everything else sits on.

In this chapter we will understand what HTML really is, how a browser uses it, how it fits together with CSS and JavaScript, and a little bit of its history. We will not memorise tags yet — first let's build the right mental picture.


What is HTML?

HTML (HyperText Markup Language) is the standard markup language used to describe the structure and meaning of content on a web page — which part is a heading, which part is a paragraph, which part is a link, an image, a list, a table, a form and so on.

Let's break the name down, because every word in it actually means something:

WordMeaning
HyperTextText that contains links to other text. Clicking a link takes you to another page or another part of the same page. This "linking" is what turned a collection of documents into a web.
MarkupExtra labels (called tags) that you put around content to say what that content is. You "mark up" plain text, just like a teacher marks up an answer sheet with underlines and notes.
LanguageIt has a fixed set of rules (a syntax) that browsers understand.

For example, look at this small piece of HTML:

<h1>Computer Networks</h1>
<p>A network is a group of connected devices.</p>

The text "Computer Networks" is wrapped in <h1> and </h1>. These tags tell the browser: "this is the main heading". The second line is wrapped in <p> tags, which means "this is a paragraph".

The browser reads these labels and displays the content accordingly — the heading appears big and bold, and the paragraph appears as normal text.


Is HTML a Programming Language?

This is a very common interview and viva question. The short answer is: No, HTML is a markup language, not a programming language.

Why? A programming language lets you express logic — make decisions, repeat steps, store and change values, and compute results. HTML cannot do any of that on its own. There is no if, no loop, no variable in HTML. It only describes content.

FeatureHTML (markup language)C / Java / JavaScript (programming languages)
Main jobDescribe structure and meaning of contentExpress logic and computation
Conditions (if/else)NoYes
LoopsNoYes
VariablesNoYes
Can calculate 2 + 3?No — it would just display the text "2 + 3"Yes
Result of a mistakeBrowser usually still shows the page (it tries to fix errors)Compile error or runtime error

That last row is interesting. Browsers are extremely forgiving with HTML. If you forget to close a tag, the browser does not crash — it follows a precise set of error-recovery rules (written in the HTML standard) and still shows something. This is great for beginners, but it also means mistakes can stay hidden. We will see this behaviour again in later chapters.


HTML, CSS and JavaScript — The Three Layers

Modern web pages are built using three core technologies. Each one has a separate responsibility:

TechnologyResponsibilityQuestion it answers
HTMLStructure and meaningWhat is on the page?
CSSPresentation (colours, fonts, layout, spacing)How does it look?
JavaScriptBehaviour and interactivityWhat happens when the user does something?

A popular analogy is the human body:

  • HTML → the skeleton (the structure)
  • CSS → the skin, clothes and appearance
  • JavaScript → the muscles and brain that make it move and react

Here is the same idea as a small diagram:

          +-------------------------------+
          |          JavaScript           |  → behaviour (click, update, fetch data)
          +-------------------------------+
          |              CSS              |  → presentation (colours, layout)
          +-------------------------------+
          |             HTML              |  → structure + meaning (the base)
          +-------------------------------+

Notice that HTML is at the bottom. A page can exist with only HTML (it will look plain, but it works). A page with only CSS or only JavaScript and no HTML has nothing to style or control. That is why HTML is always learnt first.


A Quick Look at a Real HTML Page

Don't worry about understanding every line yet — the next few chapters explain each part. Just look at how the content is wrapped in tags:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>About Me</title>
</head>
<body>
    <h1>Hi, I am Priya</h1>
    <p>I am a <strong>second-year CSE student</strong> learning web development.</p>
    <h2>My favourite subjects</h2>
    <ul>
        <li>Data Structures</li>
        <li>Operating Systems</li>
        <li>Computer Networks</li>
    </ul>
    <p>Visit <a href="https://developer.mozilla.org/">MDN</a> to learn more about the web.</p>
</body>
</html>

When you open this file in a browser, you see:

Hi, I am Priya                          ← large bold heading

I am a second-year CSE student learning web development.
       (the words "second-year CSE student" are bold)

My favourite subjects                   ← smaller bold heading

  • Data Structures
  • Operating Systems
  • Computer Networks

Visit MDN to learn more about the web.  ← "MDN" is a blue, underlined link

Look carefully at what happened:

  • The tags themselves (<h1>, <p>, <ul>…) are not displayed. They are instructions for the browser.
  • The text "About Me" inside <title> does not appear on the page — it appears on the browser tab.
  • We never said "make the heading 2em big and bold". The browser has its own default styles. Later, CSS lets us change them.

How Does a Browser Use HTML?

When you type a URL and press Enter, a lot happens. Here is a simplified version of the journey, focused on HTML:

1. Browser sends a request  ──►  Web server
2. Server sends back an HTML file (just text!)
3. Browser PARSES the HTML text, tag by tag
4. Browser builds the DOM (Document Object Model) — a tree of objects
5. Browser downloads extra files mentioned in the HTML (CSS, images, JS)
6. Browser combines DOM + CSS and calculates layout
7. Browser PAINTS pixels on your screen

Step 4 is important. The browser does not keep your HTML as plain text — it converts it into a tree of elements called the DOM. For the "About Me" page above, the tree looks like this:

html
├── head
│   ├── meta
│   └── title  → "About Me"
└── body
    ├── h1     → "Hi, I am Priya"
    ├── p      → "I am a ", strong, " learning web development."
    ├── h2     → "My favourite subjects"
    ├── ul
    │   ├── li → "Data Structures"
    │   ├── li → "Operating Systems"
    │   └── li → "Computer Networks"
    └── p      → "Visit ", a, " to learn more about the web."

Everything you will learn later — CSS selectors, JavaScript's document.querySelector(), React components — works on this tree. That's why writing clean, correctly nested HTML matters so much.


A Short History of HTML

You don't need to memorise dates for coding, but exams and interviews sometimes ask about versions, so here is a compact timeline:

YearMilestone
1989–1991Tim Berners-Lee at CERN proposes the World Wide Web and creates the first version of HTML, along with the first browser and web server.
1995HTML 2.0 — the first formal standard (published as an IETF RFC).
1997HTML 3.2 — first version published by the W3C (World Wide Web Consortium).
1999HTML 4.01 — the dominant version for about a decade; encouraged moving presentation into CSS.
2000XHTML 1.0 — HTML rewritten with strict XML rules.
2004Browser makers form the WHATWG and start work on what becomes HTML5.
2014HTML5 becomes a W3C Recommendation — new semantic elements, native audio/video, canvas, better forms.
2019 onwardsW3C and WHATWG agree that there is one HTML standard: the WHATWG HTML Living Standard, which is updated continuously.

So, which version should you learn today? There are no more numbered versions. "HTML5" is still used as a popular name, but technically the current standard is simply HTML — the Living Standard maintained at html.spec.whatwg.org. Browsers implement features from it gradually, and you can check support for any feature on MDN.


What HTML Is Not Responsible For

A clear understanding of the boundaries saves you from bad habits:

  • HTML is not for styling. Old tutorials used tags like <font> and <center>. These are obsolete and must not be used. Colours, sizes and alignment belong in CSS.
  • HTML is not for logic. Calculations, validations beyond the built-in ones, and dynamic updates are done with JavaScript.
  • HTML is not a database. Data that changes (users, orders, marks) is stored on a server, and HTML only displays it.

The golden rule: choose HTML elements by meaning, not by how they look. Use <h1> because something is the main heading — not because you want big text.


Why Learn HTML Properly?

  • Every web job needs it. Frontend, full-stack, even many backend roles touch HTML templates.
  • Accessibility. Screen readers used by visually impaired people rely on correct HTML (headings, labels, alt text) to navigate a page.
  • SEO. Search engines read your HTML to understand what a page is about.
  • Frameworks still output HTML. React, Angular, Vue and Next.js all finally produce HTML in the browser. JSX looks like HTML for a reason.
  • It is quick to learn. You can build a real page in your first hour — which we will do in the next chapter.

Common Beginner Misconceptions

MisconceptionReality
"HTML5 is a different language from HTML."It is the same language; HTML5 was one stage of its evolution. Today it is just "HTML" (Living Standard).
"HTML is a programming language."It is a markup language. It describes content; it has no logic.
"If the page looks right, the HTML is right."Browsers silently repair many errors. Your page may look fine but have broken structure. Use a validator (covered in HTML Best Practices & Validation).
"I need special software to write HTML."Any plain text editor works. A code editor like VS Code just makes it more comfortable.
"Tags decide how things look."Tags decide what things mean. The browser's default look can be completely changed with CSS.

Interview / Exam Questions

1. What is the full form of HTML, and what does "HyperText" mean?

HTML stands for HyperText Markup Language. HyperText means text containing links (hyperlinks) that let the reader jump to other documents or other parts of the same document.

2. Why is HTML called a markup language and not a programming language?

Because it only annotates (marks up) content to describe its structure and meaning. It has no variables, conditions, loops or computation, so it cannot express algorithms — which is what programming languages do.

3. What are the roles of HTML, CSS and JavaScript?

HTML gives structure and meaning, CSS controls presentation (look and layout), and JavaScript adds behaviour and interactivity.

4. Who invented HTML, and who maintains it today?

Tim Berners-Lee created HTML at CERN around 1989–1991. Today the single official standard is the HTML Living Standard, maintained by the WHATWG (with W3C's agreement since 2019).

5. What is the DOM?

The Document Object Model is the tree of objects a browser builds after parsing an HTML document. Each element becomes a node in the tree. CSS and JavaScript work on this tree, not on the raw HTML text.

6. What happens if you make a mistake in HTML, such as forgetting a closing tag?

The browser does not stop with an error. The HTML standard defines exact error-recovery rules, so the browser repairs the structure and still renders the page — though the result may not be what you intended.


Summary

  • HTML (HyperText Markup Language) describes the structure and meaning of web content using tags.
  • It is a markup language, not a programming language — no variables, loops or conditions.
  • HTML = structure, CSS = presentation, JavaScript = behaviour.
  • The browser parses HTML into a tree called the DOM, then styles, lays out and paints it.
  • Browsers are forgiving and repair errors silently, so correctness must be checked deliberately.
  • The current standard is the HTML Living Standard maintained by WHATWG; there are no new numbered versions.

In the next chapter, Your First Web Page, we will set up an editor, write a real HTML file and open it in the browser.