What is HTML?

Difficulty: Beginner

HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the World Wide Web. Every website you visit is built on HTML at its core. HTML is not a programming language - it does not have logic, loops, or variables. Instead, it is a markup language that uses a system of tags to annotate text, images, and other content so that a web browser knows how to display them.

The World Wide Web was invented by Tim Berners-Lee in 1989 at CERN. He created HTML as part of his proposal for an information management system. The first version of HTML had only 18 elements. Today, HTML5 (the current standard maintained by WHATWG and W3C) has over 100 elements covering everything from basic text formatting to embedded video and interactive forms.

When you type a URL into your browser and press Enter, a series of steps happen behind the scenes. Your browser sends an HTTP request to a web server, which responds with an HTML document. The browser then parses this HTML document from top to bottom, building an internal representation called the Document Object Model (DOM). The DOM is a tree structure where every HTML element becomes a node. The browser then uses this DOM tree along with CSS styles to calculate the layout and paint pixels on your screen. This entire process is called the critical rendering path.

HTML files are plain text files with a .html or .htm extension. You can create them with any text editor - from simple Notepad to sophisticated editors like VS Code. Because HTML is plain text, it is human-readable and can be version-controlled with tools like Git. Browsers are very forgiving with HTML - even if you make mistakes like forgetting to close a tag, modern browsers will try their best to render something reasonable rather than showing an error.

Understanding HTML is the essential first step in web development. CSS controls how HTML elements look (colors, fonts, layout), and JavaScript controls how they behave (interactivity, data fetching, animations). But without HTML providing the structure and content, CSS and JavaScript have nothing to work with. Think of HTML as the skeleton of a webpage, CSS as the skin and clothing, and JavaScript as the muscles and nervous system.

Code examples

A Minimal HTML Page

<!DOCTYPE html>
<html>
<head>
  <title>My First Page</title>
</head>
<body>
  <h1>Hello, World!</h1>
  <p>This is my first HTML page.</p>
</body>
</html>

Every HTML page needs at minimum a DOCTYPE declaration, an <html> root element, a <head> for metadata, and a <body> for visible content. The browser renders only what is inside the <body>.

HTML Tags Annotate Content

<h1>Breaking News</h1>
<p>Scientists discover a new species of deep-sea fish
   in the Mariana Trench.</p>
<a href="https://example.com">Read more</a>

HTML tags like <h1>, <p>, and <a> tell the browser what role each piece of content plays. The browser applies default styling - headings are large and bold, paragraphs have spacing, and links are blue and underlined.

Viewing Page Source

<!-- You can view any website's HTML by: -->
<!-- 1. Right-click on a page and select "View Page Source" -->
<!-- 2. Or press Ctrl+U (Windows) / Cmd+Option+U (Mac) -->

<!-- Try it on any website to see real-world HTML! -->

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>View Source Demo</title>
</head>
<body>
  <p>Right-click this page and choose "View Page Source"</p>
</body>
</html>

Every webpage's HTML is publicly visible. Viewing page source is one of the best ways to learn how real websites are built. Browser developer tools (F12) also let you inspect and modify HTML in real time.

Key points

Concepts covered

HTML, Markup Language, Web Browsers, World Wide Web, Rendering