Introduction to HTML
The backbone of every web page
Skills taught: html.basics, html.structure
HTML stands for HyperText Markup Language. It is the standard language for creating web pages. Every web page you have ever visited — Google, YouTube, Wikipedia — is built on HTML.
HTML does not look like traditional code. Instead of writing instructions, you annotate content with tags. A tag tells the browser what kind of content something is.
Your first HTML
Here is the simplest possible HTML document. Every element you see here has a specific purpose:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first web page.</p>
</body>
</html>
<!DOCTYPE html> — tells the browser this is HTML5<html> — the root element that wraps everything<head> — invisible metadata (title, character set, styles)<body> — everything visible on the page<h1> — the main heading<p> — a paragraph of text
Tip: Try it yourself — open Notepad (Windows) or TextEdit (Mac), paste the code above, save it as hello.html, and open it in your browser. No install required.
How tags work
Most HTML elements have an opening tag and a closing tag. Content goes between them. The closing tag has a forward slash / before the element name.
<!-- Opening tag Content Closing tag -->
<p> Hello! </p>
<!-- Self-closing tag (no content, no closing tag needed) -->
<img src="photo.jpg" alt="A photo" />
<br />
<input type="text" />
- Element
- The complete unit of an HTML tag plus its content. <p>Hello</p> is one element.
- Attribute
- Extra information added to a tag. In <img src="photo.jpg" alt="A photo">, src and alt are attributes.
Nesting: elements inside elements
HTML elements can be nested inside each other. The element you open last must be the one you close first — like matching parentheses.
<!-- Correct nesting -->
<p>This is <strong>bold</strong> and this is <em>italic</em>.</p>
<!-- Wrong nesting (don't do this) -->
<p>This is <strong>wrong</em></strong></p>
Warning: Incorrect nesting causes unpredictable rendering. Browsers try to fix it automatically, but the result may not be what you intended.
HTML is not programming
HTML is a markup language, not a programming language. It cannot add numbers, make decisions, or respond to user actions. It only describes structure and meaning. You will add logic with JavaScript later.
Frequently Asked Questions
Do I need to install anything to write HTML?
No. HTML works in any text editor (Notepad, VS Code, TextEdit) and any browser. You do not need a server or any install to get started — just save a file with .html extension and open it.
Is HTML case-sensitive?
No, HTML tag names are case-insensitive. <P> and <p> are the same. However, the convention is lowercase — all modern guides and specifications use lowercase tag names.
What is the difference between HTML and HTML5?
HTML5 is the current version of HTML, released in 2014. It introduced semantic elements (article, section, nav), native audio/video, canvas, and better form controls. Modern browsers support HTML5 natively.
Can I learn HTML without CSS or JavaScript?
Yes. HTML is completely independent. You can build a fully structured, readable web page with only HTML. CSS adds styling and JavaScript adds behavior — but HTML stands on its own.