Skip to content

HTML Cheat Sheet — Complete Reference (65+ tags, 2026)

Last verified May 2026 — runs in your browser
HTML Cheatsheet
<!DOCTYPE html>

HTML5 document type declaration

Structure
<html lang="en">

Root element with language

Structure
<head>

Document metadata container

Structure
<body>

Document body (visible content)

Structure
<div>

Generic block container

Structure
<span>

Generic inline container

Structure
<link rel="stylesheet" href="style.css">

Link external stylesheet

Structure
<script src="app.js" defer></script>

Link external script (deferred)

Structure
<template>

Reusable HTML template (not rendered)

Structure
<h1> to <h6>

Heading levels 1 (largest) to 6

Text
<p>

Paragraph

Text
<a href="url">

Hyperlink

Text
<a href="url" target="_blank" rel="noopener">

Link opening in new tab (secure)

Text
<strong> / <b>

Bold / strong importance

Text
<em> / <i>

Italic / emphasis

Text
<br>

Line break

Text
<hr>

Horizontal rule / thematic break

Text
<ul> <li>Item</li> </ul>

Unordered list

Text
<ol> <li>Item</li> </ol>

Ordered list

Text
<blockquote>

Block quotation

Text
<code> / <pre>

Inline code / preformatted text

Text
<mark>

Highlighted text

Text
<abbr title="Full Text">FT</abbr>

Abbreviation with tooltip

Text
<form action="/submit" method="POST">

Form element

Forms
<input type="text" name="q" placeholder="Search">

Text input

Forms
<input type="email" required>

Email input with validation

Forms
<input type="password">

Password input (masked)

Forms
<input type="number" min="0" max="100" step="1">

Number input with range

Forms
<input type="checkbox" checked>

Checkbox input

Forms
<input type="radio" name="group" value="a">

Radio button (grouped by name)

Forms
<input type="file" accept="image/*" multiple>

File upload (images, multiple)

Forms
<input type="range" min="0" max="100">

Slider input

Forms
<input type="date">

Date picker input

Forms
<input type="color">

Color picker input

Forms
<textarea rows="4" cols="50"></textarea>

Multi-line text input

Forms
<select> <option value="a">A</option> </select>

Dropdown select

Forms
<label for="email">Email</label>

Label linked to input by id

Forms
<button type="submit">Send</button>

Submit button

Forms
<fieldset> <legend>Title</legend> </fieldset>

Group form elements

Forms
<datalist id="opts"> <option value="A"> </datalist>

Autocomplete suggestions

Forms
<img src="img.jpg" alt="Description" loading="lazy">

Image with lazy loading

Media
<picture> <source srcset="img.webp" type="image/webp"> <img src="img.jpg" alt=""> </picture>

Responsive image with formats

Media
<video src="vid.mp4" controls autoplay muted></video>

Video with controls

Media
<audio src="audio.mp3" controls></audio>

Audio player

Media
<iframe src="url" title="Embed"></iframe>

Embedded frame (video, maps)

Media
<canvas id="c" width="300" height="150"></canvas>

Drawing surface for JS

Media
<svg viewBox="0 0 100 100">

Scalable vector graphics container

Media
<table> <thead> <tr><th>Name</th></tr> </thead> <tbody> <tr><td>John</td></tr> </tbody> </table>

Complete table structure

Tables
<th colspan="2">

Header spanning 2 columns

Tables
<td rowspan="3">

Cell spanning 3 rows

Tables
<caption>Table Title</caption>

Table caption (accessibility)

Tables
<header>

Page or section header

Semantic
<nav>

Navigation links

Semantic
<main>

Main content (one per page)

Semantic
<article>

Self-contained content

Semantic
<section>

Thematic grouping of content

Semantic
<aside>

Sidebar / tangential content

Semantic
<footer>

Page or section footer

Semantic
<figure> <img src="" alt=""> <figcaption>Caption</figcaption> </figure>

Figure with caption

Semantic
<details> <summary>Click to expand</summary> Hidden content </details>

Collapsible details

Semantic
<dialog open>Modal content</dialog>

Dialog / modal element

Semantic
<time datetime="2025-01-15">Jan 15</time>

Machine-readable date/time

Semantic
<meta charset="UTF-8">

Character encoding

Meta
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Responsive viewport

Meta
<meta name="description" content="Page description">

SEO description

Meta
<meta property="og:title" content="Title">

Open Graph title (social)

Meta
<meta name="robots" content="index, follow">

Search engine directives

Meta
<link rel="icon" href="favicon.ico">

Favicon

Meta
<link rel="canonical" href="url">

Canonical URL (avoid duplicates)

Meta
<title>Page Title</title>

Document title (shown in tab)

Meta
Showing 70 of 70 elements

HTML Cheat Sheet — Tags, Forms, Semantic Elements & Attributes Reference

HTML has been the markup of the web since Tim Berners-Lee published the first draft in 1991, and although it has grown from a dozen tags to a few hundred, most pages still lean on a small core: structure, text, links, forms, media, tables and a thin layer of semantics. The reference below covers 65+ of those tags grouped by job. Most trouble in real markup doesn't come from forgetting a tag. It comes from quirks that look ordinary but bite. A `<button>` placed inside a `<form>` without an explicit `type` attribute defaults to `type="submit"` and posts the form on the first Enter keypress. The `<html>` element ships with no `lang` attribute by default, which silently breaks screen readers and translation tools. An `<img>` without an `alt` value is invisible to anyone using assistive tech. These are the snippets reached for when fixing exactly that — the form attribute that controls submission, the meta tag that fixes mobile zoom, the semantic element that replaces a meaningless `<div>` — without rereading the HTML spec from line one.

Common pitfalls in HTML

A few patterns earn their place on the first screen of any HTML document. `<meta charset="UTF-8">` and the viewport meta belong in the `<head>` before anything renders, because a browser that guesses encoding wrong will mangle accented characters and emoji in ways that look like data loss but are pure markup. `<label for="id">` paired with an input is the single line that makes a form usable with a screen reader or a tap on mobile — labels are not decoration. The `rel="noopener"` attribute on every `target="_blank"` link prevents the opened page from reaching back into the opener's window, a security default the spec did not adopt for years. And `<main>`, `<article>`, `<nav>`, `<header>`, `<footer>` carry real meaning for search engines and accessibility trees that a `<div>` does not. The cheatsheet groups all of this into structure, text, forms, media, tables, semantic landmarks and meta so the right section is one click away.

  • 65+ HTML tags and elements
  • 7 categories from structure to meta
  • All form input types covered
  • Semantic HTML5 elements
  • One-click copy to clipboard
  • Includes accessibility best practices

Free. No signup. Your inputs stay in your browser. Ads via Google AdSense (consent required).