HTML
HyperText Markup Language
In short
HTML is the markup language that defines the structure and content of web pages, such as headings, paragraphs, links, images, and forms.
What is HTML?
HTML describes what each piece of a web page is. It uses tags such as <h1>, <p>, and <a> to mark text as a heading, a paragraph, or a link, and the browser reads those tags to build the page you see.
An HTML document is a tree of elements. Most elements have an opening and a closing tag, and many accept attributes that add extra information, like the href of a link or the alt text of an image. The browser parses this text into the DOM, a live object model that CSS can style and JavaScript can change.
A useful analogy is a house: HTML is the frame and the rooms, CSS is the paint and furniture, and JavaScript is the wiring that makes things work. HTML is not a programming language, because it has no variables, loops, or logic; it only describes structure and meaning.
Semantic HTML means choosing elements that match their purpose, such as <nav>, <main>, <article>, and <button>, instead of generic <div> tags everywhere. It helps screen readers, search engines, and AI crawlers understand a page. HTML today is maintained by WHATWG as a Living Standard that is updated continuously rather than released in numbered versions.
At a glance
Key takeaways
- HTML defines the structure and meaning of web page content.
- Content is marked up with tags, and tags can carry attributes.
- Browsers turn HTML into the DOM, which CSS and JavaScript work with.
- HTML is a markup language, not a programming language.
- Semantic elements improve accessibility and SEO.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>My first page</title>
</head>
<body>
<!-- A heading, a paragraph, and a link -->
<h1>Hello, world</h1>
<p>This is a paragraph of text.</p>
<a href="https://example.com">Visit example.com</a>
</body>
</html>Readers ask
Is HTML a programming language?
No. HTML is a markup language: it describes the structure of content but has no logic, variables, or loops. Behavior is added with JavaScript.
What is the difference between HTML and HTML5?
HTML5 was the name of a major update, finalized in 2014, that added elements like <video>, <canvas>, and <section>. Today HTML is maintained as a single Living Standard, so the name HTML5 is mostly used informally to mean modern HTML.
What is the difference between HTML and CSS?
HTML defines what content is on the page and what it means, while CSS controls how that content looks, including colors, fonts, spacing, and layout.
See also
- CSSWeb Development, p. 14CSS is the style sheet language that controls how HTML content looks on screen, including colors, fonts, spacing, layout, and animations.
- JavaScriptWeb Development, p. 29JavaScript is the programming language that runs in web browsers to make pages interactive, and it also runs on servers through runtimes like Node.js.
- DOMWeb Development, p. 17The DOM is the browser's in-memory tree of objects representing a web page, which JavaScript can read and change to update what the user sees.
- HTTPWeb Development, p. 23HTTP is the protocol that browsers, apps, and servers use to exchange web pages and data through a simple cycle of requests and responses.
- Web AccessibilityWeb Development, p. 66Web accessibility is the practice of building websites that everyone can use, including people who rely on screen readers, keyboards, captions, or zoom.
- SEOWeb Development, p. 47SEO is the practice of improving a website's content and technical setup so that search engines can find, understand, and rank its pages for relevant searches.
- ARIAWeb Development, p. 3ARIA is a W3C standard of HTML attributes, such as role and aria-label, that tell assistive technologies what a custom widget is and what state it is in.
Free · once a week
Software and AI, explained once a week
The week's software and AI news with every term explained, plus a term to learn and a quick quiz. A two-minute read.
See this week's issueAbout this page
Page history
Added a diagram: from HTML tags to the page the browser draws.
Changes that altered what this page says. Typo fixes are not listed.
Spotted a mistake or something missing on this page?Suggest an edit
How pages are made