HTML5 Features Worth Using Today
Semantic elements, native audio and video, canvas and SVG, web storage and the browser APIs that replace whole libraries.
Read the guideEvery example on this site is a working page, not a snippet in a screenshot. Edit it in the browser, watch it render, then paste it into your project.
Six short, valid HTML examples that cover what most pages are made of. Copy any block into a file ending in .html and open it in a browser, or paste it into the live editor further down this page.
The minimum every page needs: a doctype, a language, a character set, a viewport and a title. More on page structure.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My first page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is a paragraph of text.</p>
</body>
</html>
A link to another page and an image with the alt text and dimensions browsers and screen readers need. Browse the elements library.
<a href="https://example.com/">Visit Example</a>
<img src="photo.jpg" alt="A lighthouse at sunset" width="600" height="400">
An unordered list for items in no particular order and an ordered list for steps. See every list element.
<ul>
<li>Milk</li>
<li>Bread</li>
<li>Eggs</li>
</ul>
<ol>
<li>Preheat the oven.</li>
<li>Mix the ingredients.</li>
<li>Bake for 25 minutes.</li>
</ol>
A data table with a caption, a header row and scoped column headings. Make tables work on phones.
<table>
<caption>Monthly sales</caption>
<thead>
<tr>
<th scope="col">Month</th>
<th scope="col">Units</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>120</td>
</tr>
<tr>
<td>February</td>
<td>95</td>
</tr>
</tbody>
</table>
A form with labelled fields, built-in validation and a submit button. More form examples.
<form action="/contact" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="email">Email</label>
<input type="email" id="email" name="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" rows="4"></textarea>
<button type="submit">Send</button>
</form>
The HTML5 landmark elements that give a page a header, navigation, main content and footer. Full page templates.
<header>
<h1>Site name</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
</header>
<main>
<article>
<h2>Article title</h2>
<p>Article text goes here.</p>
</article>
</main>
<footer>
<p>© 2026 Site name</p>
</footer>
Learn how to create mobile-friendly HTML tables that work on all devices.
View ExamplesDiscover how to build websites with proper semantic elements for better accessibility and SEO.
View ExamplesImplement client-side form validation using HTML5 attributes and JavaScript.
View ExamplesBuild navigation menus that work for all users, including those with disabilities.
View ExamplesExperiment with HTML and see results instantly. For more interactive examples, visit our Interactive Examples page.
New to HTML, or filling a gap? These three guides cover the ground most people need first.
Semantic elements, native audio and video, canvas and SVG, web storage and the browser APIs that replace whole libraries.
Read the guideWhy choosing the right element matters for accessibility, search engines and the developer who maintains your code next year.
Read the guideGet most of the way there with HTML attributes alone, then add JavaScript only where you genuinely need it.
Read the guide