What is HTML?

HTML (HyperText Markup Language) is the standard markup language for web pages. It describes the structure and meaning of content, such as headings, paragraphs, links, images, forms and media, using elements written as tags. Browsers parse it into the DOM, CSS styles it and JavaScript makes it interactive.

Key ideas

  • Elements and tags: <p>Hello</p> is a paragraph element with an opening tag, content and a closing tag. Some elements are void and have no closing tag (<img>, <input>, <br>).
  • Attributes add information: <a href="/about">, <img alt="Logo">.
  • Nesting creates a tree: elements contain other elements.
  • Semantics: elements carry meaning (<nav>, <article>, <button>), which helps accessibility, SEO and maintainability.

The three layers of the web

  • HTML: structure and meaning.
  • CSS: presentation (layout, colors, typography).
  • JavaScript: behavior.

Who defines it

HTML is a Living Standard maintained by the WHATWG and updated continuously rather than in numbered versions. "HTML5" was the last numbered version and is now just "HTML".

Modern HTML is powerful on its own

Many features that used to need JavaScript are now built in: <dialog> modals, the popover attribute, exclusive <details name> accordions, form validation, loading="lazy" images, and the <search> landmark.

Interview tip

Emphasize that HTML is about meaning, not appearance: choose elements for what content is, and let CSS decide how it looks.

Code example

html
1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>My first page</title>
7 </head>
8 <body>
9 <header>
10 <h1>Welcome</h1>
11 <nav><a href="#about">About</a> · <a href="#contact">Contact</a></nav>
12 </header>
13 <main>
14 <article id="about">
15 <h2>About us</h2>
16 <p>HTML gives this content <strong>structure</strong> and <em>meaning</em>.</p>
17 <img src="https://picsum.photos/320/120" alt="Random landscape" width="320" height="120">
18 </article>
19 </main>
20 <footer><p>&copy; 2026 Example Inc.</p></footer>
21 </body>
22</html>

Practice this question

Open it in the study app to track progress, take notes, listen to the answer and work through the rest of the HTML & CSS set.

Open in study app