Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
The Web and Markup  ›  Lesson

What Is a Markup Language?

What are markup languages? 12 minA markup language wraps plain text in labels that say what each piece of text is, so a program can structure and display it.

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.

Marking up a notice board messageStep 1 of 5
  1. 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.

quick drill

What does the "M" in HTML stand for?

quick drill

Which of these can HTML do on its own?

quick drill

In <p>Tea is ready.</p>, what does <p> tell the browser?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainMarkup versus programming

A friend says: "HTML is a programming language, because I write code in it." Explain, in your own words, what a markup language does and why HTML is usually not called a programming language.