HTML Cheatsheet

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

Free Online HTML Cheatsheet

A searchable HTML5 quick reference covering document structure, text elements, forms and inputs, media tags, tables, semantic HTML, and meta tags. Copy any tag with one click.

About this cheatsheet

A comprehensive HTML5 cheatsheet covering the most commonly used tags and elements.

  • 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

100% free. No signup required. No data collected or sent anywhere.

Explore All Tools