HTML cheatsheet

Syntax snippets and quick notes for revision.

HTML Introduction

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">HTML Introduction</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this html introduction pattern when a HTML task needs a small, readable starting point.

Document Structure

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Document Structure</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this document structure pattern when a HTML task needs a small, readable starting point.

Elements

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Elements</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this elements pattern when a HTML task needs a small, readable starting point.

Attributes

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Attributes</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this attributes pattern when a HTML task needs a small, readable starting point.

Headings

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Headings</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this headings pattern when a HTML task needs a small, readable starting point.

Paragraphs

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Paragraphs</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this paragraphs pattern when a HTML task needs a small, readable starting point.

Links

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Links</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this links pattern when a HTML task needs a small, readable starting point.

Images

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Images</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this images pattern when a HTML task needs a small, readable starting point.

Lists

<section aria-labelledby="lesson-title">
  <h1 id="lesson-title">Lists</h1>
  <p>Use clear HTML so browsers, users and search engines understand the page.</p>
  <a href="/learn/tutorials/html">Continue learning HTML</a>
</section>

Use this lists pattern when a HTML task needs a small, readable starting point.

Tables

<table>
  <caption>Monthly orders</caption>
  <thead><tr><th>Customer</th><th>Total</th></tr></thead>
  <tbody><tr><td>Asha</td><td>$59</td></tr></tbody>
</table>

Use this tables pattern when a HTML task needs a small, readable starting point.

Forms

<form action="/checkout" method="post">
  <label for="email">Email address</label>
  <input id="email" name="email" type="email" required />
  <button type="submit">Send receipt</button>
</form>

Use this forms pattern when a HTML task needs a small, readable starting point.

Input Types

<form action="/checkout" method="post">
  <label for="email">Email address</label>
  <input id="email" name="email" type="email" required />
  <button type="submit">Send receipt</button>
</form>

Use this input types pattern when a HTML task needs a small, readable starting point.