Welcome
This content lives in <main> inside an <article>.

HTML tags are the building blocks of every webpage. Written in angle brackets, they mark up headings, paragraphs, links, images, forms, and page regions so the browser—and assistive tools—know what each piece of content is.
A tag is the syntax (<p>, </p>). An element is the complete unit: opening tag, content, and closing tag (or a void tag like <img>). Tutorials often use both words for the same idea.
Start with the page shell (html, head, body), text (h1–h6, p), links and images (a, img), lists, a simple form, and semantic layout (header / nav / main / footer. Then open individual guides from the sidebar.
This page teaches how tags work in an HTML tutorial. Each name in the reference tables links to a focused tag page (for example HTML a Tag). For outdated markup, see Deprecated Tags; for name="value" settings, see HTML Attributes.
Tags describe structure and meaning. Use CSS for colors, fonts, and layout.
Mismatching or crossing tags breaks the tree. Close inner elements before outer ones.
Reach for header, nav, main, and article before wrapping everything in div.
A normal element has an opening tag, content, and a closing tag:
<p class="intro">Hello, world!</p> Void elements stand alone (no closing tag, no children):
<br>
<img src="photo.jpg" alt="A sunset">
<input type="text" name="email">
<meta charset="UTF-8"> Nesting must stay layered—close the inner tag first:
<!-- Valid -->
<p><strong>Bold</strong></p>
<!-- Invalid: crossed tags -->
<p><strong>Bold</p></strong> Ideas that unlock the rest of the tag catalog:
| Concept | What it means |
|---|---|
| Opening / closing | <tag> … </tag> wrap content |
| Void elements | No end tag: img, br, input, meta… |
| Attributes | Extra settings on the opening tag (Attributes hub) |
| Semantic tags | Name the role: nav, main, article |
| Generic containers | div / span when no better tag fits |
| Category | Examples |
|---|---|
| Document shell | html, head, body, title, meta |
| Text | h1–h6, p, em, strong, code |
| Links & media | a, img, audio, video, iframe |
| Lists & tables | ul/ol/li, table/tr/td |
| Forms | form, input, label, button, select |
| Page regions | header, nav, main, section, footer |
A practical beginner workflow:
<!DOCTYPE html> and an <html lang="…"> root.head; put visible content in body.alt; wrap forms with label + controls.header, nav, main, footer) for layout regions.A tiny semantic page using header, nav, main, and footer—the same idea as Example 6.
Six starter patterns: skeleton, headings, link/image, list, form, and a semantic page.
<!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 HTML</h1>
<p>Every page needs doctype, html, head, and body.</p>
</body>
</html> <h1>Page title</h1>
<p>Intro paragraph under the main heading.</p>
<h2>Section title</h2>
<p>More detail in this section.</p> <p>
Visit the
<a href="/html">HTML tutorial</a>.
</p>
<img src="/images/html-tags.webp" alt="HTML tags illustration"
width="240" height="126"> <h2>Core tags</h2>
<ul>
<li><code>p</code> for paragraphs</li>
<li><code>a</code> for links</li>
<li><code>img</code> for images</li>
</ul> ul/ol).<form action="/contact" method="post">
<label for="name">Name</label>
<input type="text" id="name" name="name" required>
<label for="msg">Message</label>
<textarea id="msg" name="msg" rows="3" required></textarea>
<button type="submit">Send</button>
</form> id.<header>
<h1>My Site</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>
</header>
<main>
<article>
<h2>Welcome</h2>
<p>Main content goes here.</p>
</article>
</main>
<footer>
<p>© 2026</p>
</footer> Common tags by category. Each name links to its dedicated tutorial in the sidebar catalog.
| Tag | Purpose |
|---|---|
<!DOCTYPE html> | Declares HTML5 document type |
<html> | Root element of the page |
<head> | Metadata container |
<body> | Visible page content |
<title> | Document title (browser tab) |
<meta> | Charset, viewport, and other metadata |
<link> | External CSS / icons |
<style> | Embedded CSS |
<script> | JavaScript |
<base> | Base URL for relative links |
<template> | Inert HTML for cloning |
<noscript> | Fallback when scripts are off |
<!-- --> | Developer comments |
| Tag | Purpose |
|---|---|
<header> | Intro / nav group |
<nav> | Navigation links |
<main> | Primary unique content |
<section> | Thematic grouping |
<article> | Self-contained composition |
<aside> | Sidebar / related content |
<footer> | Footer for page or section |
<div> | Generic block container |
<span> | Generic inline container |
<address> | Contact information |
| Tag | Purpose |
|---|---|
<h1–h6> | Heading levels |
<p> | Paragraph |
<br> | Line break (void) |
<hr> | Thematic break (void) |
<pre> | Preformatted text |
<blockquote> | Long quotation |
<em> | Emphasis |
<strong> | Strong importance |
<code> | Inline code |
<a> | Hyperlink |
<abbr> | Abbreviation |
<mark> | Highlight |
<time> | Date / time |
<del> | Deleted text |
<ins> | Inserted text |
| Tag | Purpose |
|---|---|
<ul> | Unordered list |
<ol> | Ordered list |
<li> | List item |
<dl> | Description list |
<dt> | Term |
<dd> | Description |
| Tag | Purpose |
|---|---|
<img> | Image (void) |
<picture> | Responsive images |
<audio> | Audio player |
<video> | Video player |
<source> | Media source (void) |
<track> | Text track (void) |
<iframe> | Embedded browsing context |
<svg> | Inline SVG |
<canvas> | Bitmap drawing surface |
<map> | Image map |
<area> | Map hotspot (void) |
| Tag | Purpose |
|---|---|
<table> | Table container |
<caption> | Table title |
<thead> | Header rows |
<tbody> | Body rows |
<tfoot> | Footer rows |
<tr> | Row |
<th> | Header cell |
<td> | Data cell |
<colgroup> | Column group |
<col> | Column (void) |
| Tag | Purpose |
|---|---|
<form> | Form container |
<input> | Input control (void) |
<textarea> | Multi-line text |
<button> | Button |
<select> | Dropdown |
<option> | Option |
<optgroup> | Option group |
<label> | Control caption |
<fieldset> | Grouped controls |
<legend> | Fieldset caption |
<datalist> | Suggestions |
<output> | Result display |
<meter> | Gauge |
<progress> | Progress bar |
| Tag | Purpose |
|---|---|
<figure> | Illustration / diagram |
<figcaption> | Figure caption |
<details> | Disclosure widget |
<summary> | Details summary |
<dialog> | Dialog box |
| Void tag | Use |
|---|---|
<br> | Line break |
<hr> | Thematic break |
<img> | Image |
<input> | Form control |
<meta> | Metadata |
<link> | Stylesheet / icon |
<source> | Media source |
<wbr> | Word-break opportunity |
Full A–Z browsing: use the left sidebar, or start at Deprecated Tags / <a>.
Most beginner tag bugs are nesting mistakes or using div for everything.
Browsers guess repairs when you close the outer tag first. Always close innermost first.
Do not write <br></br> or wrap content in <img>.
Jumping from h1 to h4 confuses outlines. Use sequential levels.
Prefer landmarks and articles. Keep div/span for when no semantic tag fits.
Use one main per page. Extra regions should be section or article.
Use CSS Flexbox/Grid for page layout; reserve tables for data.
Core HTML tags are Baseline web platform features. Semantic elements (header, nav, main, article) and everyday tags (p, a, img, form) work in all modern browsers.
Standard HTML elements are among the most stable parts of the web.
Bottom line: Write valid nested tags, prefer semantics, and open individual tag guides for deep attributes.
div layouts.One line: HTML tags name each piece of content—nest them correctly, prefer semantics, then dive into single-tag guides.
Open a Try It demo and build a semantic page from scratch.
8 people found this page helpful