Experiment freely with HTML tags. Modify the code on the left and watch your changes live on the right. Try adding new paragraphs, bold or italic text, and more to see immediate results!
Discover the core components of a modern, accessible webpage. Each component in this guided reference plays a crucial role in structure, SEO, and accessibility.
The doctype declaration (<!DOCTYPE html>
) tells browsers this document uses HTML5. The <html>
tag encloses all content.
<!DOCTYPE html>
<html lang="en">
...
</html>
The <head>
section holds metadata, links to stylesheets, scripts, and the page title. It is crucial for SEO and defining document settings.
<head>
<meta charset="UTF-8">
<title>Page Title</title>
<link rel="stylesheet" href="styles.css">
</head>
The <body>
tag contains all visible content—text, images, forms and interactive elements that users see.
<body>
<header>...</header>
<main>...</main>
<footer>...</footer>
</body>
Encloses introductory content or navigational controls. Typically includes a site title, logo, and primary menu.
<header>
<h1>Site Title</h1>
<nav>...</nav>
</header>
Represents the dominant content on the page. Only one <main>
should exist per page to highlight the primary subject.
<main>
<article>...</article>
</main>
Contains supplementary content like sidebars, callout boxes, or related links. It offers additional context without distracting from the main content.
<aside>
<p>Related information or ads</p>
</aside>
Defines footer content such as copyright notices, contact info, or secondary navigation. It appears at the bottom of the page.
<footer>
<p>© 2025 Your Website</p>
</footer>
Write clean, semantic, and accessible HTML by following these best practices. Also, steer clear of common mistakes that can lead to maintenance headaches and poor accessibility.
<article>
, <header>
, <footer>
).alt
text for images.<div>
when semantic elements are more appropriate).alt
on images or lang
on the <html>
tag).