Semantic HTML
Using structured semantic HTML elements within the <body> of an HTML page is a form of SEO that enhances machine readability.
HTML Elements
There are
115
HTML elements
HTML Layout
<head>...</head>Document Meta goes in the <head>
<body>Document Content goes in these elements:
Other special elements may be in the <body>, such as:
- Toast notifications
- Modals
- Special fx
- …
MDN Web Docs — Structuring documents
- Brand — logo
- Navigation
- Controls — search · theme selector · language selector ···
<a href="/" class="logo">
<img src="/logo.svg" width="64" height="64" alt="Logo"/>
<li><a href="/blog">Blog</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
Advanced - controls — 27 collapsed lines
<form role="search" action="/search" method="get" class="search-form">
<label for="site-search" class="sr-only">Search site</label>
<input type="search" id="site-search" name="q" placeholder="Search..." autocomplete="off">
<input type="checkbox" id="theme-toggle" class="sr-only">
<label for="theme-toggle" class="theme-switch" aria-label="Toggle dark mode"></label>
<!-- language selector -->
<details class="language-dropdown">
<summary aria-label="Select Language">English (EN)</summary>
<li><a href="/en/" hreflang="en" lang="en">English</a></li>
<li><a href="/fr/" hreflang="fr" lang="fr">Français</a></li>
<li><a href="/es/" hreflang="es" lang="es">Español</a></li>
<!-- Subscribe to newsletter -->
<li><a href="/login">Login</a></li>
<li><a href="/signup">Sign up</a></li>
position: fixed; Headers are often styled to stay at the top of the viewport
- Brand — logo · headline · socials · contact
- Navigation
- Legal — privacy policy · terms of service
Brand — 19 collapsed lines
<a href="/" class="logo">
<img src="/logo.svg" width="64" height="64" alt="Logo"/>
<nav class="social-links" aria-label="Social Media">
<li><a rel="me" href="https://github.com/..." aria-label="GitHub">GitHub</a></li>
<li><a rel="me" href="https://discord.com/..." aria-label="Discord">Discord</a></li>
<li><a rel="me" href="https://twitter.com/..." aria-label="X">X</a></li>
Advanced - legal — 16 collapsed lines
© 2026 Site, Inc. All rights reserved.
Designed and built by <a href="/about" rel="author">Stephen</a>.
<nav aria-label="Legal Navigation">
<li><a rel="privacy-policy" href="/privacy">Privacy Policy</a></li>
<li><a rel="terms-of-service" href="/terms">Terms of Service</a></li>
<li><a href="/cookies">Cookie Settings</a></li>
Main
The page content should be in <main>
Section
Page content should be divided using <section>
<section id='hero'>...</section>
<section id='about'>...</section>
<section id='contact'>...</section>
Aside
Aside typically contains:
- Table of contents navigation
- Related pages navigation
- Comments
- …
Article
Article typically contains:
- Forum post
- Blog article
- User comment
- Widget
- …
Content Elements
Heading
|
|
<h1> |
heading — title |
<h2> - <h6> |
heading — subtitles |
<hgroup> |
heading group · optional |
Paragraph
List
|
|
<ul> |
unordered list |
<ol> |
ordered list |
<li> |
list item |
Description List
|
|
<dl> |
description list |
<dt> |
description term |
<dd> |
description details |
<dd>Creator of Minecraft</dd>
<dd>Creator of Valve</dd>
<dd>Creator of Death Stranding</dd>
Collapsible
|
|
<details> |
details — collapsible element |
<summary> |
details summary — collapsible element title |
<summary>Click me</summary>
Table
|
|
<table> |
table |
<tr> |
table row |
<td> |
table division — cell |
<th> |
table header — header cell |
More table elements
|
|
<thead> |
table head · optional |
<tbody> |
table body · optional |
<tfoot> |
table footer · optional |
|
|
<caption> |
table caption · optional |
<colgroup> |
column group · optional |
<col> |
column · optional |
Quote
There is also an inline version of this element
|
|
<blockquote> |
block quote |
<cite> |
citation · optional |
It's always too soon to quit
<cite>Norman Vincent Peale</cite>
Code
There is also an inline version of this element
|
|
<pre> |
preformatted text |
<output> |
result output · optional |
console.log('hello world!')
Image
Advanced image elements
|
|
<picture> |
picture · optional |
<source type src> |
media source · optional |
Advanced — 4 collapsed lines

Audio
Advanced audio elements
|
|
<source type src> |
media source · optional |
<track src> |
media text track · optional |
Advanced — 5 collapsed lines
Video
Advanced video elements
|
|
<source type src> |
media source · optional |
<track src> |
media text track · optional |
Advanced — 6 collapsed lines
Map
|
|
<map> |
image map |
<area> |
image map area |
This section is currently undocumentedLet
@Stephcraft know on Discord you'd like this section
Documented Join Discord
Canvas
This element requires Javascript
<canvas width="300" height="150">
Embed
|
|
<iframe src> |
inline frame |
<object type data> |
external object · allows fallback |
src="https://zombiecraft.net"
Advanced — 2 collapsed lines
|
|
<figure> |
figure |
<figcaption> |
figure caption |
<img src='tun-tun-tun-sahur.png'/>
Tun Tun Tun Sahur
Interactive Elements
Link
Open in new tab
MDN Web Docs — <a target> HTML attribute
MDN Web Docs — <a href> HTML attribute
Download link
MDN Web Docs — <a download> HTML attribute
Relations
Links can have many relations separated by spaces
<a rel="me" href="https://github.com/Stephcraft">...</a>
<a rel="author" href="https://stephcraft.net" >...</a>
<a rel="bookmark" href="/blog/ai" >...</a>
<a rel="tag" href="/blog/tags/typescript" >...</a>
<a rel="search" href="/search" >...</a>
<a rel="help" href="/help" >...</a> Document links
"me" Link represents the document's owner · useful for socials
"author" Link to an author of the document or article
"bookmark" Permalink for the article or document
"tag" Link to a tag applied to this document
"search" Link to search through the document and its related pages
"help" Link to context-sensitive help
<a rel="next" href="/?page=3">...</a>
<a rel="prev" href="/?page=1">...</a> Pagination links
"next" Link to the document's next page
"prev" Link to the document's previous page
<a rel="license" href="/license">...</a>
<a rel="privacy-policy" href="/policy" >...</a>
<a rel="terms-of-service" href="/terms" >...</a> Legal links
"license" copyright license for the document
"privacy-policy" data collection and usage practices for the document
"terms-of-service" agreement between the user and the document provider
One of each per document · usually found in the <footer> or in the <head> as <link/>
<a rel="external" href="https://developer.mozilla.org">...</a>
<a rel="nofollow" href="https://bricksandminifigs.com">...</a> Third-party links
"external" link is not part of this website
"nofollow" link is not endorsed by this document's owner
<a rel="noopener" href="...">...</a>
<a rel="noreferrer" href="...">...</a> Privacy and Security link parameters
"noopener" excludes window.opener
"noreferrer" excludes window.opener and the Referer header
target="_blank" implies rel="noopener"
MDN Web Docs — rel HTML attribute
Button requires Javascript to function when used outside of <form>
<button>Click me!</button>
Input requires Javascript to function when used outside of <form>
Specialized
Textbox
Date time
Textarea
Textarea requires Javascript to function when used outside of <form>
|
|
<textarea> |
text area input |
placeholder="Enter text here..."
Advanced — 6 collapsed lines
Alot of text can be put in here!
Select
Select requires Javascript to function when used outside of <form>
|
|
<select> |
select input |
<option value> |
select option |
<optgroup label> |
select option group · optional |
<option>Choose an option</option>
<option value="html">HTML</option>
<option value="css">CSS</option>
<option value="js">JS</option>
Option group — 5 collapsed lines
<optgroup label="Legacy">
<option value="php">PHP</option>
<option value="flash">Flash</option>
<option value="java">JApplet</option>
|
|
<form> |
form |
<label> |
label · optional |
<fieldset> |
field set · optional |
<legend> |
legend · optional |
<output> |
result output · optional |
<form action="" method="get">
<legend>Contact information</legend>
<input type="text" name="name" required/>
<input type="email" name="email" required/>
<input type="submit" value="Subscribe!"/>
Dialog
|
|
<dialog> |
dialog — modal |
<button> |
button |
Dialog HTML
<button command="show-modal" commandfor="dialog-modal">Open dialog</button>A <button> can open a <dialog> with:
command="show-modal"
commandfor set to the id of the <dialog>
<dialog id="dialog-modal">
<button command="close" commandfor="dialog-modal">Close</button> A <button> can close a <dialog> with:
command="close"
commandfor set to the id of the <dialog>
Popover HTML
<button popovertargetaction="show" popovertarget="popover-modal">Open dialog</button>A <button> can open a <dialog popover> with:
popovertargetaction="show"
popovertarget set to the id of the <dialog popover>
<dialog id="popover-modal" popover>
<p>This is a popover!</p>
<button popovertargetaction="hide" popovertarget="popover-modal">Close</button> A <button> can close a <dialog popover> with:
popovertargetaction="hide"
popovertarget set to the id of the <dialog popover>
Search
<label for="movie">Find a Movie</label>
<input type="search" id="movie" name="q"/>
<button type="submit">Search</button>
Navigation
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
Breadcrumbs HTML
<nav class="breadcrumbs">
<li><a href="/blog">Blog</a></li>
<li><a href="/blog#web">Web</a></li>
This element is equivalent to <ul>
<a href='https://stephcraft.net'>
<li><button id="copy">Copy</button></li>
<li><button id="share">Share</button></li>
stephcraft.net
|
|
<address> |
contact address |
Text Elements
Line breaks
|
|
|
<br/> |
line break |
|
<wbr/> |
word break opportunity |
|
<hr/> |
horizontal rule |
|
Text annotations
|
|
|
<em> |
emphasis |
this is super duper important |
<strong> |
strong importance |
this is NOT it |
<small> |
small |
My project. All rights reserved |
<abbr> |
abbreviation |
HTML (Hyper Text Markup Language) |
<dfn> |
definition |
HTML It is the language used to structure content on the web. |
<q> |
quote |
I failed, more times than you tried |
<cite> |
citation |
— Chris Do |
<code> |
code |
println("hello world") |
<samp> |
sample output |
outputs hello world |
<kbd> |
keyboard input |
Press ctrl + shift + i to open devtools |
Text highlights
|
|
|
<mark> |
mark — highlight |
highlight |
<ins cite datetime> |
insert |
added |
<del cite datetime> |
delete |
removed |
Text notations
|
|
|
<var> |
variable |
𝑥 · 𝑦 |
<sup> |
superscript |
𝑥2 |
<sub> |
subscript |
H2O |
Text formatting
|
|
|
<b> |
bold |
bold |
<i> |
italic |
italic |
<u> |
underline |
underline |
<s> |
strikethrough |
strikethrough |
Machine readable
|
|
|
<data value> |
data |
<data value="minecraft-java">Minecraft: Java Edition</data> |
<time datetime> |
time |
<time datetime="2001-09-11">Sep 11</time> |
Data-driven
|
|
|
<meter value min max> |
meter |
30% |
<progress value max> |
progress |
|
Other Elements
Localization
|
|
<bdi> <bdo> |
bidirectional · Arabic, Hebrew, … |
<ruby> <rp> <rt> |
ruby notation · Japanese, Chinese & Korean |
Generic
|
|
<div> |
content division |
<span> |
content span |
Javascript
|
|
<noscript> |
Javascript fallback |
<template> <slot> |
Web components |
XML Languages
|
|
<svg> |
Scalable Vector Graphics |
<math> |
Mathematical Markup Language |
|
|
<title> |
Title |
<meta/> |
Metadata |
<link href/> |
Link |
<script> |
Scripts |
<style> |
Stylesheets |
Resources
HTML elements
MDN Web Docs — HTML elements reference
W3Schools Docs — HTML elements reference
WHATWG Docs — HTML elements reference
Semantic HTML
MDN Web Docs — Structuring documents
W3Schools Docs — HTML Semantic Elements
Web.dev Docs — Semantic HTML