If you're just getting started with web development, you've probably heard of HTML. It stands for HyperText Markup Language.
But have you ever wondered what the term markup language actually means? And why is HTML called a markup language instead of a programming language?
Before we start learning HTML, it's worth understanding these questions. Once you understand how markup languages work, HTML will make a lot more sense.
What is a markup language?
A markup language is a way of organizing and describing content using special symbols or tags.
Let's understand this with a simple example.
Imagine you're writing a document that contains a title, a few paragraphs, and some important words.
If you write everything as plain text, a computer doesn't automatically know which part is the title, which part is a paragraph, or which words are important.
For example:
My First Website
Welcome to my website!
I am learning web development.To us, the first line looks like a title, followed by two paragraphs. We can understand that because of how the text is arranged.
But how do we communicate this structure to a web browser?
That's where a markup language comes in.
Using HTML, we can write the same content like this:
<h1>My First Website</h1>
<p>Welcome to my website!</p>
<p>I am learning web development.</p>Notice the special labels surrounding the text.
<h1>tells the browser that the text is a main heading.<p>tells the browser that the text is a paragraph.
These labels are called tags, and they're a fundamental part of HTML.
When a browser reads this HTML, it understands the structure of the content and displays it accordingly.
By default, browsers usually display headings in larger, bold text and paragraphs as regular text.
The content itself hasn't changed. We've simply added information that helps the browser understand what each part represents.
That's the basic idea behind a markup language.
Why is it called "markup"?
The word markup comes from the practice of adding instructions or annotations to written documents.
Think about a teacher correcting a student's assignment.
The teacher might underline a sentence, circle a word, or write "Make this a heading" beside a line of text.
These marks provide additional information about the document without changing its original content.
Markup languages work on a similar principle.
Instead of handwritten notes, we use special tags or symbols to describe different parts of the content.
For example:
<strong>This is important!</strong>Here, the <strong> tag indicates that the enclosed text has strong importance.
A browser will typically display it in bold.
The tags give meaning to the content, while the browser decides how to present it.
How do markup languages work?
Most markup languages follow a fairly straightforward process.
You start with some content, add markup to describe it, and then use a program that understands the markup to process or display it.
In HTML, that program is usually a web browser.
Let's look at another example.
<h2>About Me</h2>
<p>My name is Alex.</p>
<p>I love learning new technologies.</p>Here, we've described three pieces of content:
- "About Me" is a second-level heading.
- "My name is Alex." is a paragraph.
- "I love learning new technologies." is another paragraph.
When you open this HTML in a browser, you won't normally see the tags themselves.
Instead, you'll see the heading and paragraphs displayed on the page.
The browser reads the markup, interprets what each element represents, and renders the content.
This is how HTML helps turn ordinary text into a structured web page.
Understanding tags, elements, and attributes
Since we're going to work with HTML throughout this tutorial, let's quickly understand three terms you'll come across frequently.
1. Tags
Tags are special markers used to identify parts of a document.
In HTML, most tags are written using angle brackets (< and >).
For example:
<p>Hello, World!</p>Here:
<p>is the opening tag.</p>is the closing tag.Hello, World!is the content between the tags.
The closing tag contains a forward slash (/) before the tag name.
Not every HTML element needs a closing tag. For example, the <img> element doesn't use one. We'll explore these differences later in the HTML tutorial.
2. Elements
An HTML element is the complete structure, typically consisting of an opening tag, content, and a closing tag.
For example:
<h1>Welcome to My Blog</h1>This entire line is an HTML element.
The <h1> and </h1> parts are tags, while Welcome to My Blog is the content.
3. Attributes
Attributes provide additional information about an element.
Consider this example:
<a href="https://example.com">Visit Website</a>The <a> element creates a hyperlink.
The href attribute specifies the address the link should point to.
So, in simple terms:
- Tags identify the markup.
- Elements represent parts of the document.
- Attributes provide additional information about elements.
You don't need to memorize everything right now. We'll work with all of these concepts in detail as we learn HTML.
Examples of markup languages
HTML is probably the most familiar markup language, but it isn't the only one.
Different markup languages are designed for different purposes.
HTML (HyperText Markup Language)
HTML is used to structure content on web pages.
It allows us to define headings, paragraphs, links, images, tables, forms, and other parts of a webpage.
For example:
<h1>My Blog</h1>
<p>Welcome to my blog!</p>
<a href="https://example.com">Read More</a>The browser understands these elements and displays them as a heading, paragraph, and clickable link.
HTML is the markup language we'll focus on in this tutorial series.
XML (Extensible Markup Language)
XML is another markup language, primarily designed to represent and exchange structured data.
For example:
<book>
<title>Learning HTML</title>
<author>Alex</author>
<price>499</price>
</book>Notice that the tags describe the information inside them.
The <title> tag contains the book title, while <author> contains the author's name.
Unlike HTML, XML doesn't have a predefined collection of tags for displaying web pages. You can define tags that describe the data you're working with.
XML is commonly found in configuration files, data exchange formats, and document formats.
Markdown
You might have already used Markdown without realizing it.
It's commonly used in README files, documentation, and platforms such as GitHub.
Markdown uses simple symbols to format text.
For example:
# My First Blog Post
This is a paragraph.
**This text is bold.**
- HTML
- CSS
- JavaScriptIn Markdown:
#creates a heading.**around text indicates bold formatting.-at the beginning of a line creates a list item.
Markdown is designed to be easy to read and write, even without a special editor.
You've probably noticed that Markdown looks quite different from HTML.
That's because not all markup languages use angle-bracket tags. Some use ordinary punctuation and symbols instead.
Is HTML a programming language?
This is one of the most common questions beginners ask.
The short answer is no. HTML is a markup language, not a programming language.
But why?
A programming language allows us to write instructions that a computer can execute. These instructions can perform calculations, make decisions, repeat operations, and process information.
For example, consider this JavaScript code:
let age = 20;
if (age >= 18) {
console.log("You are an adult.");
} else {
console.log("You are a minor.");
}Here, JavaScript checks a condition and executes different instructions depending on the result.
Now compare that with HTML:
<h1>Welcome!</h1>
<p>This is my first webpage.</p>HTML doesn't perform calculations or make decisions in this example.
It simply describes the structure and meaning of the content.
HTML itself doesn't have general-purpose programming features like if statements and loops.
That's the main difference.
A markup language describes content, while a programming language can define instructions and behavior.
How HTML, CSS, and JavaScript work together
When you begin learning web development, you'll frequently hear about three technologies: HTML, CSS, and JavaScript.
Although they're often used together, each has a different responsibility.
| Technology | Main responsibility |
| HTML | Defines the structure and meaning of content |
| CSS | Controls appearance and layout |
| JavaScript | Adds behavior and interactivity |
For example, imagine we're building a web page with a button.
HTML defines the button:
<button>Click Me</button>CSS can change the button's appearance:
button {
background-color: green;
color: white;
padding: 10px;
}JavaScript can make something happen when the button is clicked:
document.querySelector("button")
.addEventListener("click", function () {
alert("Button clicked!");
});HTML provides the button, CSS styles it, and JavaScript handles the click.
Understanding these responsibilities will help you avoid confusion as you move further into web development.
Why do we need markup languages?
You might be wondering why we need markup languages when we can already write text using a normal text editor.
The main reason is that computers need a consistent way to understand the structure and meaning of content.
Consider a website that contains hundreds of articles.
Each article might have a title, author information, headings, paragraphs, images, and links.
Without markup, these would just be pieces of text and other content with no clearly defined relationships.
Markup makes that structure explicit.
In HTML, this is useful for several reasons.
1. Organizing content
Markup helps separate headings, paragraphs, lists, tables, and other content into meaningful parts.
2. Helping browsers understand pages
Browsers use HTML to construct the document structure and display web pages.
3. Improving accessibility
Properly structured HTML helps assistive technologies, such as screen readers, understand and navigate content.
For example, using actual heading elements helps users navigate between sections of a page.
4. Helping search engines understand content
Search engines analyze HTML to understand the organization and meaning of web pages. Using meaningful elements provides useful context about the content.
Of course, HTML alone doesn't guarantee accessibility or better search rankings, but using it correctly provides a good foundation.
Final thoughts
A markup language is simply a way of adding structure and meaning to content using special tags or symbols.
HTML uses this approach to describe the content of web pages.
The most important thing to remember is that HTML tells the browser what the content represents, while CSS controls how it looks, and JavaScript can control how it behaves.
Now that you understand what a markup language is, you're ready to explore HTML itself.
In the next part of this tutorial, we'll take a closer look at HTML, how a basic HTML document is structured, and how browsers use it to display web pages.