On this page you will find simple HTML examples you can copy and paste into the PlayCode123 Code Sandbox.
This page is part of your learning path. If you are a complete beginner, first read the explanations on the homepage and then come back here.
Reminder: An HTML page usually starts with <!DOCTYPE html> and has
<html>, <head>, and <body> tags.
The <body> contains what you see on the page in the browser.
This example shows a very simple web page with a heading and a paragraph.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My First Web Page</title>
</head>
<body>
<h1>Hello, my name is Anna</h1>
<p>This is my first web page.</p>
</body>
</html>
Anna to your own name, and change the text
inside the <p>...</p> paragraph.
This example uses different headline sizes and a paragraph.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Headlines Example</title>
</head>
<body>
<h1>Topic: Aquatic Plants</h1>
<h3>Subtopic: Floating Plants</h3>
<h6>Subtopic: Tiny Details</h6>
<p>
The diversity of aquatic plants in nature is beautiful.
They can grow in ponds, lakes, and rivers.
</p>
</body>
</html>
This example shows a bullet list (<ul>) and a numbered list (<ol>).
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Lists Example</title>
</head>
<body>
<h1>Types of Aquatic Plants</h1>
<h3>Bullet List (unordered)</h3>
<ul>
<li>Floating plants</li>
<li>Submerged plants</li>
<li>Emergent plants</li>
</ul>
<h3>Numbered List (ordered)</h3>
<ol>
<li>Observe the plants</li>
<li>Identify their type</li>
<li>Write down your findings</li>
</ol>
</body>
</html>
This example shows a simple table with flowers and sizes.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Table Example</title>
</head>
<body>
<h1>Flower Sizes</h1>
<table border="1">
<tr>
<th>Flower</th>
<th>Size</th>
</tr>
<tr>
<td>Roses</td>
<td>Small</td>
</tr>
<tr>
<td>Tulips</td>
<td>Large</td>
</tr>
</table>
</body>
</html>
This example shows how to display an image with a caption. Make sure the image file is in the same folder as your HTML file.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Image with Caption</title>
</head>
<body>
<h1>Aquatic Plant Photo</h1>
<figure>
<img src="aquaticplant1.jpg" alt="Aquatic plant 1" width="300">
<figcaption>Beautiful small aquatic plant</figcaption>
</figure>
</body>
</html>
src to your own image name and update the caption text.
This example shows a simple link to another HTML page.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Link Example</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is the homepage of my simple website.</p>
<a href="about.html">Go to the About Me page</a>
</body>
</html>
about.html to another page name, and change the link text.
This example shows a simple horizontal line using <hr>.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Horizontal Line Example</title>
</head>
<body>
<h1>Section 1</h1>
<p>This is the first section of the page.</p>
<hr>
<h1>Section 2</h1>
<p>This is the second section of the page.</p>
</body>
</html>
This example shows how to make text <strong> (bold),
<em> (italic), and how to use line breaks with
<br>.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Formatting Text Example</title>
</head>
<body>
<h1>My Favourite Hobby</h1>
<p>
My favourite hobby is <strong>photography</strong>.<br>
I like to take pictures of <em>sunsets</em> and nature.
</p>
<p>
Sometimes I also take photos of my friends and family.
</p>
</body>
</html>
<br> line break inside the first paragraph.
This example creates a small “contact card” with your name, email, and a short description.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Contact Card</title>
</head>
<body>
<h1>Contact Me</h1>
<h3>Name</h3>
<p>Anna Example</p>
<h3>Email</h3>
<p>
<a href="mailto:anna@example.com">anna@example.com</a>
</p>
<h3>About Me</h3>
<p>
I am learning HTML, CSS and JavaScript on PlayCode123.
</p>
</body>
</html>
This example uses basic semantic tags:
<header>, <main> and <footer>.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Simple Semantic Page</title>
</head>
<body>
<header>
<h1>My Simple Website</h1>
<p>Learning HTML step by step</p>
</header>
<main>
<h2>Welcome</h2>
<p>
This is the main content of the page.
Here I write about my favourite topics.
</p>
</main>
<footer>
<p>Created by Anna in 2025</p>
</footer>
</body>
</html>
<main> section.