What Is a Markup Language?
Open any web page, right-click and choose "View page source". Under the photos and buttons you will find plain text with little labels in angle brackets wrapped around it. Those labels are markup, and learning to read and write them is the first step in building for the web.
The rule
Markup labels what text is; it never computes anything.
A markup language takes ordinary text and adds labels that describe it. The label does not change the words; it tells a program what role those words play. "This is a heading." "This is a paragraph." "This is a link to another page."
HTML (HyperText Markup Language) is the markup language of the web. Here is a tiny piece of it:
<h1>Monsoon Recipes</h1>
<p>Three warm dishes for a rainy evening.</p>The <h1> label marks the main heading. The <p> label marks a paragraph. A browser reads those labels and decides how to display each part: the heading big and bold, the paragraph as normal text.
Compare this with a programming language such as Python or JavaScript. A program can store values, repeat steps and make decisions. HTML can do none of that. It has no variables, no loops and no if. It only describes. That is why we call it a markup language, not a programming language.
Markup is older than the web. Word processors, typesetting systems and documentation tools have used it for decades. Markdown, the format this lesson is written in, is another markup language, just with lighter labels.
The shortcut
When you meet any piece of HTML, ask one question: "What is this text?" The answer is the label. You are not asking "how should it look?" Looks are the job of CSS, which you will meet soon.
Start with plain text
Library closed Friday. Books are due back Monday.
The common mistake is choosing a label because of how it looks ("I want big text, so I will use a heading"). The shortcut catches it: if the text is not actually a heading, it should not get a heading label.
Drills
Answer fast — trust the rule.
What does the "M" in HTML stand for?
Which of these can HTML do on its own?
In <p>Tea is ready.</p>, what does <p> tell the browser?
You want a sentence in large bold letters, but it is ordinary body text. What is the right thinking?
Remember
- Markup labels what text is; it never computes, loops or decides.
- Shortcut: for every piece of text, ask "what is this?" and pick the label that answers it.
- Trap: choosing a label for its looks. Looks come later, from CSS.
