Logo

HTML Cheat Sheet

Show more Hide more
Print

HTML elements

Main root

<html>Root of HTML document Documentation

Document metadata

<base>URL for all relative URLs Documentation
<head>Information about document Documentation
<link>Relationships document and external resource Documentation
<meta>Metadata for page Documentation
<style>CSS for styling page Documentation
<title>Title in browser's title bar or tab Documentation

Sectioning root

<body>Content of HTML document Documentation

Content sectioning

<address>Contact information Documentation
<article>Contains item of textual content Documentation
<aside>Sidebar or call-out box Documentation
<footer>Footer with information Documentation
<header>Introductory posibly with navigation or logo Documentation
<h1>,<h2> ... <h6>Six levels of section headings Documentation
<main>Dominant content of the body Documentation
<nav>Section with navigation links Documentation
<section>Standalone section, should contain heading Documentation

Text content

<blockquote>Quotation, can contain <figcaption> <cite> Documentation
<dd>Description of <dl> Documentation
<div>Generic container Documentation
<dl>Description list Documentation
<dt>Term in <dl> Documentation
<figcaption>Caption or legend in <figure> Documentation
<figure>Content with an optional caption Documentation
<hr>Thematic break (ruler) Documentation
<li>Item in a list <ol> <ul> Documentation
<menu>Alternative to <ul> Documentation
<ol>Ordered list with items <li> Documentation
<p>Paragraph Documentation
<pre>Preformatted Text in monospace font Documentation
<ul>Unordered list with items <li> Documentation

Inline text semantics

<a>Link to somewhere <a href="…"> Documentation
<abbr>Abbreviation Documentation
<b>Bold text Documentation
<bdi>Bidirectional Documentation
<bdo>Overrides the current directionality Documentation

Line break (carriage-return) Documentation
<cite>Cited creative work Documentation
<code>Fragment of computer code Documentation
<data>Machine-readable content Documentation
<dfn>Definition of a term Documentation
<em>Emphasis text Documentation
<i>Italic text Documentation
<kbd>Textual user input from a input device Documentation
<mark>Highlighted text Documentation
<q>Short inline quotation Documentation
<rp>Fall-back parentheses for <ruby> Documentation
<rt>Text component of a ruby annotation, Documentation
<ruby>Small annotation with East Asian typography Documentation
<s>Strikethrough text Documentation
<samp>Sample from a computer program Documentation
<small>Small text Documentation
<span>Generic inline container Documentation
<strong>Important bold text Documentation
<sub>Subscript text Documentation
<sup>Superscript text Documentation
<time>Date or time Documentation
<u>Underline text (Don't use, looks like a link) Documentation
<var>Mathematic or code variable in text Documentation
<wbr>Word break (like &shy; without dash) Documentation

Image and multimedia

<area>Image map with clickable areas Documentation
<audio>Embed sound content Documentation
<img>Embeds an image Documentation
<map>Clickable link part in an <area> Documentation
<track>Subtitles in <video> Documentation
<video>Embeds a media player with video Documentation

Embedded content

<embed>Embeds external content Documentation
<iframe>Embeds another HTML page Documentation
<object>External resource handled by plugin (Flash…) Documentation
<picture>Contains 0 or 1+ <source> and 1 <img> Documentation
<portal>Embeds another HTML page with navigation Documentation
<source>Multiple resources picture or video Documentation

SVG and MathM

<svg>Scalable Vector Graphics Documentation
<math>MathML (Mathematical formula) Documentation

Scripting

<canvas>Canvas API for drawing graphic Documentation
<noscript>Display if scripting is unsupported Documentation
<script>Embed JavaScript Documentation

Demarcating edits

<del>Text that has been deleted Documentation
<ins>text that has been added Documentation

Table content

<caption>Caption of a table Documentation
<col>Column within a table Documentation
<colgroup>Group of columns within a table Documentation
<table>Tabular data in two-dimensional table Documentation
<tbody>Set of table rows Documentation
<td>Cell of a table Documentation
<tfoot>Set of rows summarizing the columns Documentation
<th>Cell as header of group of cells Documentation
<thead>Set of rows defining head of columns Documentation
<tr>Row of cells Documentation

Forms

<button>Interactive element (e.g. submits a form) Documentation
<datalist>Set of options to choose from Documentation
<fieldset>Group several controls and labels Documentation
<form>Form for submitting information Documentation
<input>Element accepts data from user (field etc.) Documentation
<label>Caption for an item (field etc.) Documentation
<legend>Caption for fieldset Documentation
<meter>Scalar value within a known range Documentation
<optgroup>Grouping of options in a select Documentation
<option>Item in a select Documentation
<output>Inject the results of user action Documentation
<progress>Indicator showing progress Documentation
<select>Menu of options Documentation
<textarea>Multi-line plain-text editing Documentation

Interactive elements

<details>Information toggleble by clicking <summary> Documentation
<dialog>dialog box or dismissible alert Documentation
<summary>Summary, caption, or legend for <details> Documentation

Web Components

<slot>Placeholder can contain own markup Documentation
<template>Not to be rendered immediately, but via JS Documentation