What is HTML?
Understand what HTML is, what it is not, and how it fits together with CSS and JavaScript to build a web page.
HTML (HyperText Markup Language) is the standard markup language used to describe the structure and content of a web page — the headings, paragraphs, links, images, and other pieces that make up what you see in a browser.
What HTML actually is
HTML stands for HyperText Markup Language. "HyperText" refers to text that contains links to other text (hypertext links, or just "links"), and "Markup Language" means it uses tags to mark up, or annotate, pieces of content so a browser knows what each piece represents.
Every web page you have ever visited — a news article, a shopping cart, a social media feed — has HTML underneath it describing its structure: this is a heading, this is a paragraph, this is a list, this is an image.
HTML is NOT a programming language
This is one of the most important distinctions to get right early: HTML is a markup language, not a programming language. A programming language lets you write logic — variables, loops, conditionals (if/else), functions that compute values. HTML does none of that.
HTML only describes what content exists and what role it plays (heading, paragraph, list, table, image, link). It cannot make decisions, repeat actions, or perform calculations. If you need logic — like showing different content based on the time of day, or validating a form before submission — that is the job of JavaScript, a real programming language. Mixing this up is a common misconception, so keep it clear: HTML describes structure; it does not compute anything.
HTML's role in web development
Every web page is built from three layers that work together, each with a distinct job:
• HTML — structure and content (what is on the page: headings, text, images, links, forms) • CSS — presentation (how it looks: colors, fonts, spacing, layout) • JavaScript — behavior (what it does: responding to clicks, updating content dynamically, validating input)
How the browser turns HTML into a page
When a browser receives an HTML file, it doesn't just display the raw text. It parses (reads and interprets) the HTML and builds an internal tree-like representation of the page called the DOM (Document Object Model). Each HTML tag becomes a "node" in this tree.
The browser then uses this DOM tree, combines it with any CSS rules to figure out how each node should look, and paints the final result on screen. JavaScript can also read and modify the DOM after the page loads, which is how pages become interactive. Understanding that HTML becomes the DOM is key to understanding how CSS and JavaScript are able to target and change specific parts of a page later.
Basic HTML tag syntax
Most tags come in pairs: an opening tag <tagname> and a closing tag </tagname> (note the forward slash). The content between the opening and closing tag is what the tag applies to. Tag names are not case-sensitive in HTML, but lowercase is the universal convention.
<tagname>Content goes here</tagname>Code Examples
This is a minimal snippet of HTML content: one heading and one paragraph. Expected result: A large bold line reading "Hello World" followed by a normal-sized paragraph reading "Welcome to SampleApp." Notice there is no logic here at all — no calculation, no decision-making. It is purely a description of two pieces of content.
<h1> marks the most important heading on the page; <p> marks a paragraph of text.
Common mistake: Beginners sometimes think <h1> makes text "big" the way a font-size setting would — really it marks the text as the page's top-level heading; the browser's default large, bold look is just a style convention, not the tag's actual purpose.
This shows several different HTML elements working together: a container (<article>), a heading, a paragraph with emphasized text inside it, and a hyperlink. Expected result: A heading "Learning HTML", a paragraph with the word "structure" shown in bold, and a clickable link reading "Learn more". Elements can be nested inside other elements — <strong> is nested inside <p>, which is nested inside <article>.
<a href="..."> creates a clickable hyperlink — the "HyperText" part of HyperText Markup Language.
<h1>Hello World</h1>
<p>Welcome to SampleApp.</p><article>
<h1>Learning HTML</h1>
<p>HTML describes the <strong>structure</strong> of a page.</p>
<a href="https://example.com">Learn more</a>
</article>How a web page is built
HTML, CSS, and JavaScript are three separate technologies that each handle one concern of a web page.
WEB PAGE
|
+----------+----------+
v v v
HTML CSS JavaScript
Structure Style Behavior
(what it is) (how it (what it
looks) does)Important Rules
HTML describes structure and content — it is not a programming language and has no logic, loops, or conditionals.
Most HTML elements consist of an opening tag, content, and a closing tag.
The browser parses HTML into the DOM, a tree structure that CSS and JavaScript both work with.
CSS controls appearance and JavaScript controls behavior; HTML is the foundation both build on.
Tag names should be written in lowercase by convention, even though HTML itself is not case-sensitive.
Where this shows up
Every website you visit — from a simple blog to a complex web application like Gmail — sends HTML as the first thing your browser receives. Even highly interactive apps built with frameworks like React ultimately render down to HTML elements that the browser can parse and display.
"HTML is a programming language used to build websites." HTML is a markup language used to structure content; JavaScript is the programming language.
Calling HTML a programming language is inaccurate because it lacks logic constructs like variables, loops, and conditionals — it only describes structure.
<h1>Big Heading</h1> used purely to make text look large <h1> reserved for the actual top-level heading; use CSS (e.g. font-size) to change text size
Using heading tags just for their default visual size instead of their semantic meaning confuses both screen readers and search engines about the page's real structure.
[True / False] HTML is a programming language because it can perform calculations and make decisions using if/else logic. A. True B. False
B. False — False. HTML is a markup language, not a programming language — it has no variables, loops, or conditional logic. Logic like if/else belongs to programming languages such as JavaScript.
Write a short HTML snippet with one heading and two paragraphs describing yourself as a student on SampleApp.
<h1>Jane Doe</h1> <p>I am learning web development on SampleApp.</p> <p>My goal is to build my first website this month.</p>
Use one <h1> tag for your name and two <p> tags for two sentences about yourself.