HTML for Absolute Beginners
What is HTML?
HTML stands for HyperText Markup Language. It is not a programming language — it is a markup language, which means it describes the structure and meaning of your content.
When you visit a website, your browser downloads an HTML document and renders it on screen. The browser reads tags like <h1>, <p> and <img> to know what each piece of content is.
The anatomy of a tag
Most tags come in pairs: an opening tag and a closing tag.
<p>This is a paragraph.</p>
<p>is the opening tag</p>is the closing tag (notice the forward slash)- The text between them is the tag's content
Some tags are self-closing and do not wrap content:
<img src="photo.jpg" alt="A mountain at sunset">
<br>
Don't forget the closing tag
Forgetting a closing tag is the single most common HTML mistake. If your page looks broken, check that every opening tag has a matching closing tag.
A minimal document
Every HTML page starts with the same skeleton:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
</body>
</html>
| Part | Purpose |
|---|---|
<!DOCTYPE html> |
Tells the browser this is modern HTML5 |
<head> |
Metadata: title, charset, links to CSS |
<body> |
The visible content of the page |
Your first exercise
- Create a new file named
index.html - Copy the skeleton above into it
- Open the file in your browser
You should see "Hello, world!" displayed as a large heading. Congratulations — you just wrote your first web page.
Advertisement