Code Reference

Glossary

Html · Reference cheat sheet

Glossary

Html · Reference cheat sheet


📋 Overview

Alphabetical glossary of core HTML terms for document structure, semantics, forms, media, and accessibility.

🔧 Core concepts

TermDefinition
AccessibilityDesigning markup so assistive technologies can perceive and operate content.
AnchorAn <a> element that creates a hyperlink to a URL or page fragment.
ARIAAttributes that expose roles, states, and properties to assistive tech.
AttributeA name/value pair on a start tag that configures an element.
Block elementAn element that typically starts on a new line and fills available width.
BodyThe <body> element containing visible page content.
CanvasAn <canvas> element providing a drawing surface via JavaScript.
DoctypeThe &lt;!DOCTYPE html> declaration that puts browsers in standards mode.
DocumentThe full HTML tree rooted at <html> and represented as the DOM.
DOMThe in-memory tree of nodes browsers build from HTML.
ElementA node created by a start tag, optional content, and an end tag.
FormAn <form> that collects controls and submits data to a server or script.
HeadThe <head> section for metadata, links, scripts, and title.
HeadingRanked titles <h1><h6> that outline document structure.
IframeAn <iframe> that embeds another browsing context/document.
Inline elementAn element that flows within text without forcing a new line.
InputA form control (<input>) whose behavior depends on its type.
LandmarkA region role such as nav, main, or aside for page navigation.
MetaMetadata elements describing charset, viewport, SEO, and more.
Semantic HTMLUsing elements whose meaning matches content, not just presentation.
SlotA placeholder in a shadow tree filled by light-DOM children.
SVGScalable vector graphics markup embeddable in HTML.
TableMarkup (<table>, <tr>, <th>, <td>) for tabular data.
TemplateAn inert <template> whose content can be cloned into the document.
Void elementAn element that cannot have children, such as <img> or <br>.
Web componentCustom elements, shadow DOM, and templates used as reusable widgets.

💡 Examples

Semantic landmarks:

<header>
  <nav aria-label="Primary">
    <a href="/">Home</a>
  </nav>
</header>
<main>
  <h1>Docs</h1>
  <article>...</article>
</main>

Form controls:

<form action="/signup" method="post">
  <label>
    Email
    <input type="email" name="email" required />
  </label>
  <button type="submit">Join</button>
</form>

Picture and responsive images:

<picture>
  <source srcset="hero.avif" type="image/avif" />
  <img src="hero.jpg" alt="Product hero" width="1200" height="600" />
</picture>

⚠️ Pitfalls

  • Confusing <div> (generic box) with semantic elements like <section> or <article>.
  • Mixing block and inline mental models with modern CSS display — HTML defaults are only defaults.
  • Using ARIA to “fix” bad markup instead of preferring native semantics.
  • Treating <iframe> like a simple include — it is a separate document with security boundaries.
  • Equating <template> content with live DOM — it stays inert until cloned.

On this page